Fast way to add Python command to Quick Favorites menu?

Is there a fast way to grab a few lines of Python from the Info panel, and with a click or two, add them as an action to the Quick Favorites menu?

I know it’s possible to save Python scripts and build custom menus, but I’m looking for a quick way to keep a constantly changing set of custom commands at my fingertips, much like I do in Maya where I drag commands onto the shelf to instantly create a button.