Python select empty action line in NLA Editor for Blender 2.8 API
Use the API methods.

This can be done via low level calls.  Test script below, adds a new track "Foo", adds the action strip, starting at frame 1, using and named after object action.

When adding the track can specify the previous track to insert or append in different orders.

Only requirement is to  have reference to  an object with an action. Note adds empty animation data if none exists. Test against None to bypass

import bpy

context = bpy.context
ob = context.object

ad = ob.animation_data_create()

action =  ob.animation_data.action

if action:
    track = ad.nla_tracks.new()
    track.name = "Foo"
    strip = track.strips.new(action.name, 1, action)