I figured out why deleting /usr/local/bin/python solves the problem: As Loïc said, this is surprising because totem uses libpython and not the python executable. However, libpython tries to be clever and looks for the executable itself. That's why deleting the executable steers it towards the system default python in /usr, where pygtk can be found and everything is fine.
A very simple workaround and possibly a fix for the bug is to set PYTHONHOME to "/usr", i.e. call Totem with "PYTHONHOME=/usr totem".
I still think that Totem shouldn't segfault on a missing pygtk, though. The problem with this is in totem-python-module.c: If pygtk can't be found, "totem_python_module_init_python" simply prints a warning and returns. "init_pygobject" is never called, but "totem_python_module_load" later calls "pyg_gil_state_ensure", which leads to the segfault.
I figured out why deleting /usr/local/ bin/python solves the problem: As Loïc said, this is surprising because totem uses libpython and not the python executable. However, libpython tries to be clever and looks for the executable itself. That's why deleting the executable steers it towards the system default python in /usr, where pygtk can be found and everything is fine.
A very simple workaround and possibly a fix for the bug is to set PYTHONHOME to "/usr", i.e. call Totem with "PYTHONHOME=/usr totem".
I still think that Totem shouldn't segfault on a missing pygtk, though. The problem with this is in totem-python- module. c: If pygtk can't be found, "totem_ python_ module_ init_python" simply prints a warning and returns. "init_pygobject" is never called, but "totem_ python_ module_ load" later calls "pyg_gil_ state_ensure" , which leads to the segfault.