Original question:
Executing mathematical user code on a python web server, what is the simplest secure way?
Have you looked at pypy's sandboxing features? It is reputedly much safer than any CPython sandboxing efforts. You can even limit the heap size and cpu execution time to prevent denial of service.