Just implemented something I've had in mind for a while: compositor-side blocking out of windows from screencasts! The compositor is the perfect place to do this since it can replace the window contents in the render tree, which will work fine with any kind of overlapping, transparency, etc. AND it will work with anything that records the screen through the portal, be it OBS or video meeting, or whatever.
There's actually an important edge case here: if you open the screenshot UI while recording the monitor, then the screenshot UI preview will show the window, and OBS, recording the screenshot UI preview, will hence also show the window. There are trade-offs here for how you want this to work; for now I put a big warning around the option, and added a stricter mode that blocks out the window from ANY screen capture (which means you can't screenshot it).