def remove_chars(seq):
    """Remove all non digit characters from a string, but cleanly passthrough non strs.

    Parameters
    ----------
    seq : Any
        Strings will be modified, any other type is directly returned

    Returns
    -------
    Any
        The original sequence, minus non-digit characters if input was a string

    """
    seq_type = type(seq)
    if seq_type != str:
        return seq

    return seq_type().join(filter(seq_type.isdigit, seq))