I definitely agree with what has been said above. Hamster owners have reported their poor little hamsters getting their ribs/spines crushed whilst in leashes. I've even heard horror stories of hamsters getting their leash tangled when their owners weren't looking and unfortunately passed due to strangulation
Playpens all the way! They don't have to be super expensive either, and can be as customizable as you'd like. As mentioned above, there are some awesome DIY playpen ideas on here, here's a good one
Stylish playpen
If you don't want to make/buy one, you can simply use something like an empty bathtub or shower! Fill it with boxes and hideouts, hide treats all about, and offer chews and other items to keep them entertained. Good luck, if you have any other questions, please ask