if word.lower() in banned_words:
    return ''
else:
    return word
sentences = ["I'm eric. Welcome here!", 'Another boring sentence.',
    'GiraffeElephantBoat', 'sfgsdg sdwerha aswertwe'] * 250000
for sentence in sentences:
    sentence = re.sub('\\w+', delete_banned_words, sentence)
Ускорьте миллионы замен регулярных выражений в Python 3