How do I lock multiple bones location in Pose Mode?
With the armature selected and in pose mode this will set the location lock for every bone. You may also want to lock the rotation by setting lock_rotation

import bpy
for b in bpy.context.active_object.pose.bones:
    b.lock_location[0] = True # x
    b.lock_location[1] = True # y
    b.lock_location[2] = True # z


If you want to do it using a preset list of bone names -

bone_list = ['upper_arm.L','upper_arm.R','thigh.L','thigh.R']
for bn in bone_list:
    bone = bpy.context.active_object.pose.bones[bn]
    bone.lock_location[0] = True # x
    bone.lock_location[1] = True # y
    bone.lock_location[2] = True # z