There are a million ways to do that, like not collecting data in the first place unless a user opts-in to your research group for example.
But companies chose the most user-hostile one intentionally. Essentially forcing everyone to give consent anyways (just click the big bright “consent” button!)
The fact that you’re able to maintain any amount of privacy at all on the internet is thanks to the EU, you can decline the pop-ups. If it wasn’t for that, then you wouldn’t even know when companies were abusing your data in the first place.