How do I go from BVH to a working F-Curve?
Your biggest issue is, the bvh rig uses ZXY euler rotations, your martha rig is in quaternions. 

Here is a script to set martha's pose bones to ZXY eulers.  Select martha in pose mode and run script.

import bpy

martha = bpy.context.object
for pb in martha.pose.bones:
    pb.rotation_mode = 'ZXY'


or import the bvh file with quaternion rotation.

nextly, you will need to do a better job of renaming martha's bones to match bvh rig.

An alternative approach.  Here is code to add a copy rotation constraint to each bone on martha, to a matching bone on bvh rig.  Note: I imported the bvh file and have a rig from that import named "Beer chug", change name in code to suit name of bvh rig.  

It simply looks for bone names in martha that match bvh rig and adds a copy rotation constraint from one to other. 

import bpy
context = bpy.context
scene = context.scene
rig_to = scene.objects.get("Martha")
rig_bvh = scene.objects.get("Beer chug")
martha = rig_to
# remove action from martha
martha.animation_data.action = None

for bvhpb  in rig_bvh.pose.bones:
    pb = martha.pose.bones.get(bvhpb.name)
    if pb is None:
        print(rig_to.name, " has no bone ", bvhpb.name)
        continue
    c = pb.constraints.get("bvhrot") or pb.constraints.new('COPY_ROTATION')
    c.name = "bvhrot"
    c.target = rig_bvh
    c.subtarget = bvhpb.name
    c.owner_space = c.target_space = 'WORLD'


Once you have a "driving rig" set up for a certain mocap, it's simply a matter of importing bvh, changing animation on driver rig and martha will follow.  For CMU for instance each bvh file in subject has the same rig.  In differing subjects the bone naming convention is the same but may have differing proportions (Depending on the actor(s) used I suppose).  This mainly only effects locations.

Note also you don't need to have same bone names, just a way of matching bone to bone.  There are some tools in "Motion Capture Tools" addon to do this.