Python3's own json-library refuses to serialize the result of serialize_compact() since it is not a py3 str but a py3 bytes. This breaks our code, at the least. I'm not sure about the best way to solve it. A flag that sets encoding and if set spits out str and not bytes? Doing another walkthrough throught the code and choosing when to use str vs. bytes instead of always using bytes? Add to the json-library upstream so that it can serialize bytes, assuming that you tell it the encoding to use?
Anyway, the documentation for the function says it returns str, which it does not do on python3.