Anti-debugging (and even anti-anti-anti-debugging) tricks have been commonplace on the DOS/Windows side of things for a long time. Any old cracking/unpacking information will discuss those in varying amounts of detail.
How easy it is for the user to have control over what apps do is inversely related to how user-hostile the platform is. PT_DENY_ATTACH seems like a feature specifically invented for the purpose of serving the latter. Of course on the Windows side, which I believe doesn't have such a feature, the trick is to make the app attach to itself instead:
https://www.x86matthew.com/view_post?id=selfdebug
https://anti-debug.checkpoint.com/techniques/interactive.htm...