code: def c_str(string):
      Convert a python string to C string."""
      if not isinstance(string, str):
          string = string.decode('ascii')
      return ctypes.c_char_p(string.encode('utf-8'))
docs: Convert a python string to C string.