Earlier quoted context omitted.
Shouldn't unhex() just be int(s, 16)? Not sure what it adds, but I don't quite understand it yet and perhaps there's something magic in the context of MIME quoted printable that I'm missing.
That is an excellent point! Based on my reading, there's nothing magic. The context is: elif i+2 I tweaked it to new = new + bytes((int(line[i+1:i+3], 16),)); i = i+3 and the self-tests still pass. (I also changed the 16 to 15 to double-check that the tests were actually exercising that code.) It's not part of the public API, so it looks like it can simply be removed. Do you want to file the bug report? Or perhaps it…
https://docs.python.org/3/library/functions.html#int
So that is actually standard. Maybe I just don't know what you mean by public API though.