Latest PyCharm 2018.2 EAP build introduces "on-demand" variable loading policy. I believe it should fix your problem: PY-29468.