docs: def native_string_to_bytes(s, encoding="ascii", errors="strict"):
      """
      Ensure that the native string ``s`` is converted to ``bytes``.
      """
      if not isinstance(s, str):
          raise TypeError("{} must be type str, not {}".format(s, type(s)))
      if str is bytes:
          # Python 2
          return s
      else:
          # Python 3
          return s.encode(encoding=encoding, errors=errors)