I'd like you do give away 100% of your salary, ok?
Are you greedy if you say no?
If someone posts something to StackOverflow, they're intending to help both the original person and anyone that comes along later with the same question with their coding problem, and that's the extent of it.
An artist making a painting or song has not consented to training algorithms on their copyrighted work. In fact, neither has the StackOverflow person.
Boggles my mind this concept is so absent from the minds of SV folk.
This is what you don't understand: the concept of fair use.
https://en.wikipedia.org/wiki/Fair_use
If the courts hold this type of thing to be fair use (which I'm about 90% sure they will), "consent" won't enter into it. At all.
[0] https://www.theverge.com/2023/1/17/23558516/ai-art-copyright...
[1] https://variety.com/2023/digital/news/scarlett-johansson-leg...
The situation described in your second reference is already unlawful, regardless of how the image was produced. You're not allowed to make commercial use of images of Scarlett Johansson even if you scratch them on a cave wall with a broken deer antler.