How do I change actions in python
All actions in the file are saved in bpy.data.actions

for a in bpy.data.actions:
    print(a.name)


The action associated directly with your object, the one I'd call "in the slot"

action = object.animation_data.action


To set it to another action named "anotheraction"

object.animation_data.action = bpy.data.actions.get("anotheraction")


If there is no action named anotheraction it will set it to None.  If there is no animation data on the object you will need to call

object.animation_data_create()


beforehand.

Note: can also have actions on any strip in the strips collection of an nla track in the animation_data.nla_tracks collection of your object.