I suggest you use distilled water near the boiling point with a small amount of non volatile electrolyte added to help the electric current. In the past a few drops of sulfuric acid were added after the electric potential was applied to protect the electrodes.
Then hot water vapor strips out the hydrogen fast enough to remove it from the reaction zone. If you don't purify the water then a simple inhibitor will not protect against every possible side reaction.
For economy a steam electric generator might be used with condensate and electricity sent to electrolysis. Then the boiler feed water would be pre softened and treated with scale inhibitors offered by water treatment chemical companies.
Using a hot water means that increasing the cost price of Hydrogen produced...but in any way we can use solar energy (cheaper) for preheating water....
Thank you very much for your interesting answer...
It remains valid for a lesson demonstration, but on a large scale to produce (H2) fuel it becomes expensive unless we couple the electrolyser with a solar distillation unit ? !!!