Reporting back. Using existing libraries, this is much simpler than I was making it. Here's some sample Python code which posts "Hello, World!" to topic ID 2. Thanks, @julian, for telling me about socket.io.
@Enrique the main problem you seem to be having is that you are not aware that there is a frontend and a backend to NodeBB. You have to wire up the controls from the ACP and make a call to the backend (via websocket, for example), and then you can call server side libraries.