Optimize built-in unicode codecs by avoiding unnecessary copying.

The approach used is similiar to what is currently used in the version
of unicodeobject.c in Python 2.x. The only difference is we use
_PyBytes_Resize instead of _PyString_Resize.
1 file changed