Script to delete unused Empties
List comprehension

Every now and then issues occur when removing objects from the collection that is being iterated over. (possibly an issue of the past) Now as a matter of choice I use list comprehension to create the filtered list.

For our filter, an empty has None for its data, and [] for children if none, both of which are boolean false. 

A  popped member is removed until the list is empty.  The bpy.objects.remove(...) has a do_unlink property that has a default of False, setting to True removes the need to unlink from scene(s).

import bpy

childless_empties = [e for e in bpy.data.objects
        if not (e.data or e.children)]

while childless_empties:
    bpy.data.objects.remove(childless_empties.pop(), do_unlink=True)