How to completely delete an object through python?
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.)