How do I remove test code that sticks to the Info Panel?
Reload Scripts.

Go to the python console and type in:

bpy.ops.script.reload()


Or press F3 to bring up the Search Menu and type Reload Scripts:



You will have to run any non registered script again to have a single menu.  I have this operator prepended to my py console and text editor areas.

Or temporarily tack it to top of script while developing.

It had the default keymap  F8 in 2.7x and prior.