I have a game, written in Python, and I use Panda3d.
Now I want to have a possibility for restart, that is, I want to press a button with the result that the main is executed again, just as if the current instance of the game had never existed.
Is there a simple way to do this?
Not really.  Panda3D doesn't really make this abstraction, that's up to the application developer.  It depends on the specific case what "restart" really means; do you want to close the existing window and then reopen a new one?  If not, then that means that you have to keep many Panda3D objects in place and can't simply recreate the ShowBase instance.  But do you then want to unload any models loaded into memory?  Do you want to resend the geometry for your UI objects to the graphics card?
So, depending on your specific needs, you will have to unload and get rid of the objects that you need to restart and then recreate them.  If you use an object oriented approach and structure your objects properly, this should be straightforward - ie, you implement an unload() on your Game object that unloads things specific to that game, and then let the references to that object go (causing it to be garbage collected), and create a new one.  (Beware of circular references!  If you have them, they may keep old instances of your objects in memory even when they have gone out of scope.)
panda3d - how to restart a game