"Do not track" is exactly the feature you're talking about and already exists in all common browsers.
What it's missing is a reason for websites to comply, which is what a law could enforce.
What it's missing is a reason for websites to comply, which is what a law could enforce.