  
      If strings_only is True, don't convert (some) non-string-like objects.
      """
      # Handle the common case first for performance reasons.
      if issubclass(type(s), six.text_type):
          return s
      if strings_only and is_protected_type(s):
          return s
      try:
          if not issubclass(type(s), six.string_types):
 
</s> remove         if not issubclass(type(s), six.string_types):
 </s> add         if not issubclass(type(s), str): </s> remove     if isinstance(value, six.string_types):  # Handle strings first for performance reasons.
 </s> add     if isinstance(value, str):  # Handle strings first for performance reasons. </s> remove     if isinstance(s, six.memoryview):
 </s> add     if isinstance(s, memoryview): </s> remove     if isinstance(value, six.string_types):  # Handle strings first for performance reasons.
 </s> add     if isinstance(value, str):  # Handle strings first for performance reasons. </s> remove                 s = six.text_type(s, encoding, errors)
 </s> add                 s = str(s, encoding, errors)
    if issubclass(type(s), str):
  
      If strings_only is True, don't convert (some) non-string-like objects.
      """
      # Handle the common case first for performance reasons.
    if issubclass(type(s), str):
          return s
      if strings_only and is_protected_type(s):
          return s
      try:
          if not issubclass(type(s), six.string_types):
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/utils/encoding.py