Just don't make code online accessable if you don't want your code used.
The same thing as with images.
The same thing as with images.
An AI model that correctly references copyright holders and the applicable licenses would be preferential to not having the code available, IMHO.
I dont see why you would be advocating for people not to share their code in the first place. That seems couterproductive, and against the spirit of open source in general.