You know, I based this in the OSL node design. Or more specifically in our discussions regarding not removing links without the user being aware.

But I think I can make it work by calling a "shallow update" once renderviews are updated. It should remove a socket only if there is no socket linked to the socket. Otherwise it will only hide the views. Also I'm showing only the active views there.

I think my initial problem (apart from the rule of avoiding destroying sockets) was to find a nice way of finding when to update. (rna update function should do, though).