Molten electrolysis, not hydrolysis. Sodium chloride is by far a cheaper substitute for sodium hydroxide, but the energy required for the extra 500°C melting point may offset the cheaper buying price. The chlorine gas is also a nuisance. The process would be slightly more efficient, though, because the water produced in hydroxide oxidation absorbs some of the heat and also reacts with the sodium metal, reversing the reaction. The main problem is the higher melting point.
Sodium metal is dangerous enough. Do not try to extract potassium. Sodium metal is easily stored in substances like mineral oil. If you went outside, made some potassium, and tried to store it in mineral oil, you could cause an explosion. Because of its greater reactivity, potassium reacts with oxygen to yield peroxides and superoxides, which are explosive when in contact with organic compounds. The peroxides and superoxides even exothermically react with the unexposed potassium. There are a few stories of large explosions in potassium manufacturing plants because the potassium was exposed to oxygen before being stored in mineral oil or kerosene. Even if you manage to store it without problems, if there is any oxygen in the container, it will slowly react with the potassium. The peroxide is a shock-sensitive explosive, which could be set off by simply opening the container. There are so many things that could go wrong. It's better to just steer away from that idea.