I untarred the Python source, did a configure --with-fpectl (I got that from the ebuild) and make, make install. That put python into /usr/local (I guess I could have found a configure option to fix that).

Anyway, it turns out that emerge calls /usr/bin/python2.2, so I linked that to my new python. The only other thing I had to do was copy the contents of /usr/lib/python2.2/site-packages into /usr/local/lib/python2.2/site-packages.

emerge then worked, so I quickly emerged python properly.

Since then I have been finding other packages not working properly (libxml2 and vim so far) and rebuilding them.