Oh, Alexey, can't you do everything you need for koi8 without hacking
the C code, by doing simply:
;;; koi8.el:
(when (not (featurep 'mule))
(keyboard-translate 'Cyrillic_hardsign 'ydiaeresis)
...
)
My apologies if this was already considered and rejected.
It would be good if the following worked as expected.
(keyboard-translate 'Cyrillic_hardsign ?ΓΏ)
but this has different results from the above.