For example, Steam could run this as a subprocess if desired.
This is just a prototype, and hasn't been fully thought through.
Steam would ideally run this as a subprocess via
steam-portal --exit-with-parent (optionally with
--replace), so that it is automatically terminated when Steam exits.
The OpenKeyboard method would be enough to implement a GTK/Qt input method something like this:
As prototyped here, it requires the steam-runtime-tools library, but it could be adapted to not.