Reset Blender scene to default state

I have a script that generates scenes after each iteration is completed I delete all the mesh properties but still not all the data has been deleted.
Is there any convenient way to reset blender scene to it’s default state, using script? (like when you open Blender)

This should work
bpy.ops.wm.read_homefile(app_template="")

1 Like

It won’t be good for me. the problem is that this line will terminate the execution of the script as well.