an indirect answer to your question, maybe have a look at WireHopper | Food4Rhino , code is on github and in comments there is another repo that has python implementation
I had a look but the functionality is not quite what I am looking for.. I bashed the script by AI and the free version of Venice was clever enough to fix it. funny times.
so this basically sets the wires of all static parameter objects (sliders, MDsliders, Swatches, etc) to faint. (well, it looks if the downstream component has such an object type connected)