"Look mates, if you don't clean up your stuff, we're gonna have to write a bunch of laws and nobody wants that, so, fix your problems". (i.e: Government is aware legislating something probably results in a highly suboptimal/inefficient endresult, but, it's the only tool governments have. It's just as much on a company / on all companies in a given area of expertise that government sees no way out other than to wield the heavy and inaccurate club of law-making).
Separate from the many comments that highlight both how [A] the GDPR is a lot more than those cookie banners and [B] those cookie banners are like those email footers - lawyers gone nuts. A whole bunch of them are not required as per GDPR, just there because someone asked a lawyer and of course they say 'yeah sure add it'. If I ask a painter if it's a good idea to paint my house at this point in time, they're bound to say 'yes':
Companies went way too far with it, so GDPR happened. It's a good thing to teach companies that going too far results in annoying laws. It's fine even if the GDPR is a loser - if everybody loses, that's.. sad, and a better law would be much preferred, but that can still be better than no laws, because its mere existence tells companies to try not to go too far.
So far, US-based companies do not appear to have understood this (see also: USB-C rules, apple's current problems, repeated and widespread illegal shit going on at banking institutions), but it's worth doubling down on it until they do.