The Python DBAPI supplies the Binary() function for exactly this purpose: http://www.python.org/dev/peps/pep-0249/#binary

It also seems this is how sqlalchemy does its conversion of binary data for the backend: http://docs.sqlalchemy.org/en/rel_0_8/core/types.html#sqlalchemy.types.LargeBinary

Would that be usable here too, or rather not?