> Are there any open source licenses that explicitly forbid use when training an AI?
No, though plenty don’t license for that purpose and/or would require any work thereby created requiring w license to use the same license (e.g., all copyleft licenses).
But since Copilot and others use publicly available (independent or license, not specifically open-source) code on the basis that such use does not require a license, the license isn't going to stop them. Are you prepared to sue Microsoft to prevent them from using your code? If not, given their position on “Fair Use”, you aren't going to stop them.