Python raw-string to hex/base64