def to_casefold(string, conv=str):
    """
    Convert the input to a string and casefold it.

    Conversion is done by `conv`, which is normally :py:class:`str`, but
    :py:func:`repr` is sometimes a good choice as well.
    """
    return conv(string).casefold()
