>> You could use _PyLong_AsByteArray. > > I'm scared by the underscore. If that helps, feel free to submit a patch to remove the underscore, and document the function properly. Regards, Martin