import re


def replace_mentions(text, filler='@user'):
    """Replaces Twitter @mentions in text with `f' {filler}'`.
    Potentially induces duplicate whitespaces.
    """
    # Positive lookbehinds: https://stackoverflow.com/a/40617321/4949133
    username_regex = re.compile(r'(?:(?<=^)|(?<=[^@\w]))@(\w{1,15})\b')
    # Replace other user handles with the filler
    # Added space to separate the mention from non-space characters behind
    text = re.sub(username_regex, f' {filler} ', text)
    return text