Thanks for the tip.
A batch mode sounds interesting. Is there something like Emacs daemon mode for TeXmacs?
At the moment I just masked the X11 window when indexing by an Xvfb call, so that the users sees not window opening when doing a conversion, but that is as far as I was able to get myself. In combination with a batch mode I could have an invisible TeXmacs linger in the background and convert whenever the index daemon asks it to. That should be fast enough.