def sanitize_name_for_disk(name: str):
    """
    Removes illegal filename characters from a string.

    :param name: String to clean.
    :return: Name with illegal characters removed.
    """
    return "".join(char for char in name if char not in "|<>:\"/?*\\")