>>davidg+(OP)
I would imagine the root problem here is people taking copyrighted code, pasting it in their project and disregarding the license. To me this seems common, especially when it comes to toy, test and hobby projects.
I don't see how copilot or similar tools can solve this problem without vetting each project.