> As far as I know, Linux still doesn't support a variable-sized swap file...
You can add (and remove) additional swapfiles during runtime, or rather on demand. I'm just unaware of any mechanism doing that automagically, though.
Could probably done in eBPF and some shell scripts, I guess?
swapspace (https://github.com/Tookmund/Swapspace) does this. Available in Debian stable.