code: def _format_str(string):
      
      if isinstance(string, _STRTYPES):
          if _IS_PYTHON3:
              array = _array.array('I')
              array.frombytes(string.encode(_utf32_codec))
          else: # Python 2
              if isinstance(string, unicode):
                  array = _array.array(b'I')
                  array.fromstring(string.encode(_utf32_codec))
              else:
                  array = _array.array(b'B')
                  array.fromstring(string)
          return array
      return string
docs: Attempt fast string handing by decoding directly into an array.