Apple's iCloud Private Relay feature is a great way to improve privacy and security while you are browsing online. Its effect is similar to a VPN, but neither Apple nor the target website know both your IP address and the URL you are visiting.
However, some websites insist on seeing this information, often because they use it for identification purposes. You can reveal your IP address for a single page by right-clicking the Reload arrow in Safari's URL field, but some websites include redirections that keep this from working. Our university's SSO mechanism is one example. In these cases, you want to turn Private Relay on and off quickly, but Apple does not provide a quick way to do so.
So I wrote a macro that lets you toggle Private Relay on and off with a single keypress or mouse click. It opens the System Settings window and clicks the right buttons to toggle that status; you can see it at work while it is running. You can map this to a single keypress (I use Fn-F6 because of its 'Do Not Disturb' moon icon), or you can trigger it from a menubar icon. I even designed a cute icon for it.
It currently works for macOS 15.2. You might need to tweak it slightly for newer macOS releases since the System Settings UI tends to change a bit. Or just check back at the URL below; I may have already done that for you: