Although the OP has moved to OBS I will leave a solution here for anyone else.
I've put together a python CLI for Streamlabs Desktop:
https://github.com/onyx-and-iris/slobs-cli?tab=readme-ov-file#stream
So in this case it would be as simple as slobs-cli stream start.