Using Python loop to attach empty to each bone in Armature
Script for 2.8

Test Script:

Select your armature object in object mode. Adds an empty at each pose bone location. Creates a child of constraint for each.

As it is for 2.8 uses @ for matrix multiplication.  For prior, globally replace @ with *

import bpy

context = bpy.context
ob = context.object
mw = ob.matrix_world

mts = []
for pb in ob.pose.bones:
    bpy.ops.object.empty_add(location = (mw @ pb.matrix).translation)
    #bpy.ops.object.empty_add()
    mt = context.object
    mt.name = "MT_%s" % pb.name
    cl = mt.constraints.new(type='CHILD_OF')
    cl.target = ob
    cl.subtarget = pb.name  

    mwi = (mw @ pb.matrix).inverted()
    cl.inverse_matrix = mwi


Notes:


after an add object operator, the newly added object is context.object or context.active_object.  Do not rely on it being context.selected_objects[0]
The target for the constraint is the armature object, the subtarget is the bone, by name.