The `xdotool` is available in the https://brew.sh so you can just use the provided `desktop-pause.sh` script with a shortcut which does exactly that - "grabs the active window and sends stop/continue signals to that window".
I'm thinking we'd like to use something like Hammerspoon or AppleScript to fetch the PID of the currently focused window.