from typing import Container


def blacklist(
    string: str,
    invalid_chars: Container[str]=(),
    rep_char: str='_',
) -> str:
    """Replace any characters in the blacklist with the replacement char."""
    chars = list(string)
    for ind, char in enumerate(chars):
        if char in invalid_chars:
            chars[ind] = rep_char
    return ''.join(chars)