Improve error handling and organization of python-related C code

- split python-related code from init_engine and engine_draw_frame to
  init_python and python_draw_frame respectively
- use the fallback drawing function not only if init_python fails, but also
  if any step of argument tuple construction in python_draw_frame fails