The solution here seems simple. If you don't want your code used for AI/ML like co pilot, then place a license in your code that explicitly forbids it. Looking at the MIT License as-is, which is used by many maintainers on github, there is nothing that forbids co-pilot. It's easy to add a few sentences to that which explicitly forbid the code being used by AI, ML, code generation or other code automation and calling it something else like the Free For Human Use License.
The sticky part may be: does GitHub T/C overrule these licenses?