astroid (pylint's underlying library for AST) is holding a cache of ast per module. Try the code below to throw away the whole cache:
from astroid import MANAGER
MANAGER.astroid_cache.clear()
Relevant issue: https://github.com/PyCQA/pylint/issues/158