Delete linked node from out-/inputs index
The case in your picture can be done like
in_soc = your_principled_node.inputs['Base Color']  # example
if in_soc.links:
    from_node = in_soc.links[0].from_node
    your_material.node_tree.nodes.remove(from_node)