Moving to C is not a bad idea at all. It would shake out those issues. The RFC bit is more to get it so you can rip it apart and do the thing in any language. I have done a few of these sorts of things over the years. It is very easy to tie yourself to a particular language library without realizing it. Sometimes just writing down what bits go back and forth and responsibility helps shake out those oddities. If I were doing it I would probably start with a port with something like C just so I could understand what is really needed and what is cruft. Then doc it into the RFC format as I went along.