If only the simple output is not connected to the Material Output does it still cost (significant) performance or is it just like deleting the complex node setup completely?
I think material nodes will skip unused outputs. Not sure about compositing nodes, though.
It’s easy to test this, though- Set up a few different materials with different numbers of used/unused nodes and compare render times.
During shader compilation cycles will start at the output node and walk the graph back to gather just the nodes it needs, so unconnected parts of the graph cost nothing at render time.
Does this happen only on the final render or does it work in the viewport as well?
Viewport as well, it’s just how the shader compilation works