If you don't want people to learn from your code then don't open source it. Learning via LLM vs person learning is a distinction that sounds unenforceable in practice.
Legally, of course, LLMs are not people. They don’t have the same rights as people, and it isn’t obvious whether or not they can legally generate new IP. They operate by a complicated but essentially mechanical process, and it is pretty novel to say that such a process could be used to remove copyrights.
But the defendant won't be Microsoft — they just provided a tool, and that's legal. No, the defendant will be the downstream consumer who incorporated the code spat out by the LLM.
It doesn't matter whether the LLM "learned" — intent is irrelevant and the defendant will have committed copyright violation regardless. The LLM can't copyright-wash the code — nobody can.