to_str=compat.string_type by default, which is
str on Python2 (so breaks when the function gets non-ascii arguments).
The tests don't catch this, because they explicitly pass
to_str=compat.text_type, which does the right thing.
Are the backwards-compatibility concerns, or could the default be changed to
text_type, which would certainly be less... surprising, out-of-the-box.