My Pixel 7 (Android 14) has a persistent ssh server set up, but Termux shows a "wake lock held" notification, which is very annoying. Is it possible to hide notifications so that they exist and work but are not displayed in the notification area?
That depends on the definition of "exist and work". As far as I know it will still hold the wakelock if the notification is hidden, as the notification is only a nicety. If it's hidden though it won't be possible to tap it to open the app.
It should be possible to press and hold the notification to get options for the apps notifications, then choose which notifications you want to disable or just disable everything. And then can be enabled again via App Info -> App Notifications.
Phantom Process Killer may be the actual cause of the app getting killed. There is a plethora of notes about how it works and how to disable it on different versions of Android 12+ "at your own risk" in this project on GitHub. The links at the top that point to Termux GitHub Issues and Google Issue Tracker go into some technical discussions about it.
Most Android 13+ devices should have an option to disable this via Settings -> Developer Options -> Disable child process restrictions as per this Reddit thread, noting in a comment that it's not included by Samsung, Oppo, and Xiaomi. It was originally added in Android 12L, but that was targeted for folding devices, large screens, and tablets.