A different approach would be for you to independently fork kloak and then get it merged into Tails or even better packages.debian.org. Maybe it doesn’t need to come to that. Let’s see how active upstream now is.
A wholly different idea: Any reason this must be written in C? Could this be rewritten in python or something?
I was pleasantly surprised that the C level suggestions in https://github.com/vmonaco/kloak/pull/49 got a positive review from upstream.
Before I overload (low activity) upstream with more suggestions by chatgpt… (I wanted to wait until Multi-device support by vmonaco · Pull Request #38 · vmonaco/kloak · GitHub and https://github.com/vmonaco/kloak/pull/49 are merged.9
Could I ask you please (apparently higher activity) to have a look at my GitHub - adrelanos/kloak at chatgpt2 branch. (Just increasing branch numbers by 1.) Has only 1 commit for now. Fix potential buffer overflow vulnerabilities · adrelanos/kloak@11f48c4 · GitHub
I am hoping it can fix grave usability issues such as starting kloak resets keyboard layout · Issue #12 · vmonaco/kloak · GitHub and keyboard randomly sometimes stops working · Issue #31 · vmonaco/kloak · GitHub by more defensive coding to fix some broken corner cases.
Not sure if you have access to chatgpt4 (version 4). But if you have, could you run it through chatgpt4 please to see if it can find (and even fix) some more code issues (in upstream dev branch or your branch)?