The python library has no direct base 256 conversion function and it's too late to get a patch into 2.2. However, converting long to hex with hex(...) and then using binascii for binary output, or binascii for binary to hex followed by long(h,16) to convert hex to long, is reasonably fast.