Hi
In the blend file below I have simple plane mesh, with armature modifier (armature is None). And simple blender operator script.
If I redo simple blender operator (by changing operator F6 property), blender will crash, on line:
obj.to_mesh(bpy.context.depsgraph, apply_modifiers, calc_undeformed=False)
If I remove the armature modifier, or set armature modifier object to skeleton, it works ok.