We've been informed by Max ([email protected]) that he created a fully compatible TypeScript port of the SAP LZH and LZC algorithms which is way more readable than the original C code:
https://sr.ht/~xje4/sapcomp/
Regarding issues such as #5 it should still be a goal to remove the old C-code from pysapcompress. Max is happy to answer questions regarding the algorithms and give insights.