The problem with CGI

Why not just keep using CGI?

What could be better?

There are a lot of schemes that keep the Python (or other scripting language) interpreter running instead of starting and stopping it, e.g. FastCGI and SCGI, and others that embed it into the web server itself, e.g. mod_python, mod_wsgi. But these are, finally, just halfway measures. If the issue is to avoid having two large-footprint pieces of software running why not just write a customized web server in Python so that we have complete control and good performance? Since Python will be running the whole time, the cost of running a script reduces from loading a 4+MB language interpreter to loading a (say) 2KB script. Furthermore the code will be streamlined compared to a complete server because it will only contain code for things that it will actually do, and not code for anything that anyone, anywhere might conceivably want it to do (as a general purpose web server must provide).