dispatch: convert exception payload to bytes more carefully
We were previously depending on str() doing something reasonable here,
and we can't depend on the objects in question supporting __bytes__,
so we work around the lack of direct bytes formatting.
help: convert flag default to bytes portably
We were relying on %s using repr on (for example) integer values. Work
around that for Python 3 while preserving all the prior magic.