Create buttons to hide and run code

By any chance are you working in JupyterLab? If so, one idea would be to just show your users how to use the uncollapsing of code cells that is built-in. If you are working with recent JupyterLab, you can collapse all the code cells and when the notebook is reopened, the state will be respected. Then users can toggle individual ones to be visible. If they don’t want the code visible, they will still run. See here for more information about this feature of JupyterLab. This may empower your users more because it isn’t some custom solution that they won’t find elsewhere. And it is already inherent in the current version of the Jupyter interface.
Right now the default JupyterLab binder example isn’t building right, I can point you here where you can launch JupyterLab and test it.