Not sure exactly which function you meant. There is PyUnicode_AsUTF8AndSize (no “String”), but that is marked as new in 3.3 and I would hesitate to drop support for 3.2. I’ll investigate using something like PyUnicode_AsUTF8String (no “Size”) instead.

I’ll also go over the whole thing and add error checks where I think they’re necessary.