Reset blender environment on each script run
I fear that this can only give a partial answer.

I wrote an add-on (totally work in progress..but whatever) which gives the python console in Blender a second function. Hitting Enter, executes normal python stuff, but I can type commands and hit Cltr+Enter and the add-on will read the current line and parse it and react to it. One command I do tend to use a lot is wipe it removes all objects/meshes, the code for it is pretty much:

    elif m == 'wipe':
        remove_obj_and_mesh(context)
        add_scrollback('wiped objects and meshes', 'OUTPUT')
        # history_append(text=m, current_character=0, remove_duplicates=True)
        history_append(text=m, remove_duplicates=True)


This even prints the message 'wiped objects and meshes' in blue to the Python console

The code for remove_obj_and_mesh() is:

def remove_obj_and_mesh(context):
    scene = context.scene
    objs = bpy.data.objects
    meshes = bpy.data.meshes
    for obj in objs:
        if obj.type == 'MESH':
            scene.objects.unlink(obj)
            objs.remove(obj)
    for mesh in meshes:
        meshes.remove(mesh)


 

I've not tested that on hidden objects, but if you can link a representative file / blend state which you would like to wipe entirely or selectively, i recommend posting it and that will let us/me answer more concisely.

ps. blenderscripting.blogspot is my blog, i should probably change that code