That leads to the question if it is possible to implement a ROS node
into a shared library and starting that node without roslaunch and
environment variables like ROS_MASTER_URI. Does anyone did something
like that already?

You're going to need some way of pointing the ROS node at its master (if there are 10 robots with 10 masters, how do you figure out the one you want), but that's something that you could once and for all at install time and store as a registry entry.