How to completely delete an object through python? How to completely delete an object without using:

bpy.ops.object.delete()


bpy.ops methods are too slow for my script, so far I am able to delete an object with a simple:

del obj


But Blender does not reset/delete names of the deleted objects with this method, so I end up with Cube.344, Cube.599, etc..

Also, deleted objects are not linked to the scene.
You are looking for the remove function.
import bpy
objs = bpy.data.objects
objs.remove(objs[&quot;Cube&quot;], do_unlink=True)

The code above deletes an object named &quot;Cube.&quot; The first parameter of the remove function is the object to remove, the second is a boolean about first unlinking the object (you want it set to True.)