Attached is my abortive effort at refactoring PyCXX in support of a different project. My original intent was to bring PyCXX up-to-date with the object model improvements released in Python 2.2.
As I got deeper into the process, I came to realize that I actually didn't mind working with the Python C API as such; in fact I kind of preferred it. The main hassle was the refcounting. So, I ended up writing myself an auto_ptr like PyObject* handle class template and bagged the rest.
I'm donating this to your project, since its based on your code and I have no further interest in developing it. You are welcome to ignore it, take pieces of it, or use it in its entirety as you see fit.