If it is necessary to exclude all nodes of a certain type from the shader calculation, they can be muted by their type. The muted node remains in the node tree, retaining all links, but doesn’t affect the final result.
Manually this can be done by highlighting the desired node and pressing the “m” keycode.
All nodes of the required type in all materials can be muted with the Python API using the following code:
for mat in bpy.data.materials:
for node in mat.node_tree.nodes:
if node.type == 'BEVEL':
node.mute = True
It loops through all the materials in the scene and mutes the “Bevel” node in each material.