Although cStringIO is faster it does not handle unicode

https://docs.python.org/2/library/stringio.html#module-cStringIO

Unlike the StringIO module, this module is not able to accept Unicode
strings that cannot be encoded as plain ASCII strings.