Single slider for transparency in Material Preview/Rendered display
If you don't mind not being able to directly tweak the shader's alpha in the shader editor, you can set a driver between the viewport display alpha and the shader alpha. Note that you can also set it the other way around, drive the viewport alpha with the shader alpha.
import bpy

obj = bpy.context.object

mat = obj.active_material 
# Make sure the material has a principled BSDF (replace with appropriate node name)
if mat and mat.use_nodes and mat.node_tree.nodes[&quot;Principled BSDF&quot;]: 
    alpha_input = mat.node_tree.nodes[&quot;Principled BSDF&quot;].inputs[&quot;Alpha&quot;]  # Store access to the alpha input
    driver = alpha_input.driver_add(&quot;default_value&quot;).driver  # Create a new driver and store it
    [driver.variables.remove(value) for value in reversed(driver.variables.values())]  # Clear the driver
    var = driver.variables.new()  # Add a new variable
    
    target = var.targets[0]  # Access the first driver variable and set appropriate paths...
    target.id_type = 'MATERIAL'
    target.id = mat
    target.data_path = &quot;diffuse_color[3]&quot;
    driver.expression = &quot;var&quot;

Result :

As an addendum, if you want to drive the principled BSDF's color with the viewport display color, you have to add a driver to each of the color property's dimensions. Here's how to do it. Add these lines at the end of the previous code :
color_input = mat.node_tree.nodes[&quot;Principled BSDF&quot;].inputs[&quot;Base Color&quot;]
for channel in range(3):
    driver = color_input.driver_add(&quot;default_value&quot;, channel).driver
    [driver.variables.remove(value) for value in reversed(driver.variables.values())]
    var = driver.variables.new()

    target = var.targets[0]
    target.id_type = 'MATERIAL'
    target.id = mat
    target.data_path = f&quot;diffuse_color[{channel}]&quot;
    driver.expression = &quot;var&quot;

Result:

As a side note, you don't have to clear the driver variables, but it does not automatically get removed when accessing this particular field's driver (I think), and if you try adding new variables to a driver without checking first if it already has some, it will simply add more and more. That could lead to some serious bloat if you accidentally run this operation multiple times.