Is there a way to delete bones that don't have any weight assigned to them?
This is a little round-about, but if your zero-weight bones have their deform-attribute toggled off, there is a plugin to convert IK-Chains to FK-Chains whose side-effect is tossing out all the non-deforming bones from the armature.

Take a look at it here:
https://github.com/chinedufn/blender-iks-to-fks