How can we assign simple script to hotkeys or buttons in a simple way?

That add-on indeed handles the original problem (even if only in the N-Panel).

But it requires an additional add-on. Since Blender doesn’t handle add-on dependencies, users would install an add-on and get frustrated it doesn’t work, because they don’t also have the ScriptToButton add-on installed.