On your second point given that China is so developed now in major cities and nationalism so strong, I think there's a lesser chance of people wanting to stay in the west after receiving their education.First, the Soviet Union was mostly state socialist. Modern China is mostly capitalist + combined with some significant state socialist, but really only pretends to be Communist. China's mostly capitalist economy has some huge advantages over the Soviet primarily socialist economy.
Second, inviting people to learn and be educated in Western institutions isn't the issue. Historically, most educated immigrants stay in the West and provide a positive brain surplus, and this brain surplus significantly outweighs any negatives of potential spying. For every immigrant scientist who turns out to be a spy, you have hundreds to thousands of immigrant scientists who decide to stay and positively contribute to the science and technology of this country.
Wikipedia for example has a short list of hundreds of Russian American immigrant scientists born in the USSR who contributed to the USA in math, science, technology, etc.
The main issue is when state and corporation institutions directly steal technology from other companies, or when STEM people begin engage in direct espionage of selling pre-existing confidential technology to other countries (usually for profit).