The fact that pyuno is welded to a specific instantiation of LibreOffice/OO and the included version of Python causes a lot of grief. If LibreOffice is running headless and talking over a socket, data and requests are being serialized into some wire format, right? Is there a reason why this wire format can't be documented and then broken out into an independent Python module so that the user's choice of Python could access and control LibreOffice via the socket? Thanks.
So what you are asking for is effectively the python equivalent of the URE, which is the set of C++ libraries and headers that can be used to build C++ applications that talk to LibreOffice. Doing a URE for python is technically possible, but quite a lot of work.
I can't say I'm surprised. I figured that if it were easy to do, then it would have been done already. This isn't unique to LO. Nobody has a good answer to this. Blender wrote its own widgets in order to communicate effectively with Python. LO and KiCad weld in specific versions of Python. I don't know of anybody who has a complex application which allows external processes to drive them effectively. (I haven't tried VBScript or AppleScript in a long time, so I can't comment about those.) I presume that the only effective way would be to convert the URE into a serialization layer with and have IPC/RPC use that. And I say this as someone who is sitting here, writing what is effectively a crappy web spreadsheet in Javascript *again*, when what is really needed is to drive LO in real-time from an outside process. I know it won't happen soon. But, if I don't at least file something, it will happen *never*.
Its not quite that hard, it is mostly a packaging problem of copying the right subset of stuff into some place that is convenient for an external python to consume. But then there are likely to be a variety of difficult issues around python's native code loading stuff which will require some coding chops to solve.