code: def getString(t):
      
      slen = c_int()
      s = c_char_p()
      if PL_get_string_chars(t, byref(s), byref(slen)):
          return s.value
      else:
          raise InvalidTypeError("string")
docs: If t is of type string, return it, otherwise raise InvalidTypeError.