<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def overloaded_constants(type_, __doc__=None):
 """A factory for transformers that apply functions to literals. Parameters type_ : type The type to overload. __doc__ : str, optional Docstring for the generated transformer. Returns ------- transformer : subclass of CodeTransformer A new code transformer class that will overload the provided literal types. """

    typename = type_.__name__
    if typename.endswith('x'):
        typename += 'es'
    elif not typename.endswith('s'):
        typename += 's'

    if __doc__ is None:
        __doc__ = _format_constant_docstring(type_)

    return type(
        "overloaded_" + typename,
        (_ConstantTransformerBase,), {
            '_type': type_,
            '__doc__': __doc__,
        },
    )