My habit on Windows, entirely in the muscle memory after two decades of doing it, is:
- If the text to sanitize is a single line: Win+R, paste, select all, cut, Esc (to close "Run" window)
- If it's multiple lines: Win+R, notepad, Enter, paste, select all, cut, Alt+F4 (to close notepad)
On Linux, I usually switch to Emacs, switch to a scratch buffer, then do the paste-and-cut-again dance in it.