code: def extern_val_to_str(self, context_handle, val):
      
      c = self._ffi.from_handle(context_handle)
      v = c.from_value(val[0])
      # Consistently use the empty string to indicate None.
      v_str = '' if v is None else text_type(v)
      return c.utf8_buf(v_str)
docs: Given a Handle for `obj`, write str(obj) and return it.