The problem isn't that Microsoft can access you code. It's the section D.4 on Github's terms of service [1]. If you are hosting your code on Github, you are essentially giving Microsoft the legal rights to do certain things with your code. That section is broad enough to allow Microsoft to train copilot with your code. It gives them the freedom to disregard the license. On the other hand, it would be a clear violation of the license if they read your code off another hosts and reproduced it verbatim. I don't know whether any legal challenges would stand in a court, but at least you are not giving away the right to do so.
[1] https://docs.github.com/en/site-policy/github-terms/github-t...