Not GP, but sometimes I want my browser to do pretty random/niche things without that compromising all of my browsing data.

Create a new profile, do the niche thing there, separately from the rest of your browsing.

How can the browser tell the difference between a random thing you want and a random thing you don't want?

The permissions mechanism.