code: def to_string(s, encoding=None, errors='strict'):
      
      if isinstance(s, bytes):
          return s.decode(encoding or 'utf-8', errors)
      elif not isinstance(s, str):
          return str(s)
      else:
          return s
docs: Inverse of to_bytes