Wave texture change values by python code
You can access a node input sockets by either their name or their rank using their inputs property:
distortion_socket = wave_texture.inputs['Distortion']

or
distortion_socket = wave_texture.inputs[2]

Then you can set the value using default_value (the value not given by a link):
distortion_socket.default_value = 2