Forgive me if this isn’t what you want, but is this possibly what you’re looking for?
import bpy
for o in bpy.data.objects:
if o.animation_data:
for n in o.animation_data.nla_tracks:
n.name = o.animation_data.action.name
Note: An action must be active on an object before the tracks of it can be accessed. I couldn’t find a global method of accessing nla_tracks through bpy.data.actions
, oddly. I’m probably overlooking some minor detail.