How to Override Poll for Clear_Parent in Background mode
Don't use the operator.
It is pretty simple to clear parent (set to None) and keep transform with simple API calls.
Python console code., clear parent on context object.
&gt;&gt;&gt; mw = C.object.matrix_world.copy()
&gt;&gt;&gt; C.object.parent = None
&gt;&gt;&gt; C.object.matrix_world = mw
&gt;&gt;&gt; 

Similarly, via API calls,  to remove non meshes from scene
&gt;&gt;&gt; non_meshes = [o for o in C.scene.objects if o.type != 'MESH']
&gt;&gt;&gt; non_meshes
[bpy.data.objects['Empty'], bpy.data.objects['Camera'], bpy.data.objects['Sun']]

&gt;&gt;&gt; while non_meshes:
...     D.objects.remove(non_meshes.pop())
...     
&gt;&gt;&gt; non_meshes = [o for o in C.scene.objects if o.type != 'MESH']
&gt;&gt;&gt; non_meshes
[]