Illegal is illegal, you might escape that for a while but expect to experience worst if you get caught. I don't want to be on this position at all cost, I will avoid or stop doing such illegal things. If the government suddenly ban gambling in your area, then I believe you still have time to withdraw your money on a gambling site and for now better to forget about gambling and focus in other things. Your government might revise that decision so by that time, you can gamble again legally.
Gambling is fun to some people. If the government ban gambling, some people will look for ways to avoid the ban and continue to gamble. That is people for you. I will not like if the government in my country ban gambling, but why they legalized it before and later suddenly ban it? They supposed to have banned it from the beginning, but not when many people has already liked it. There would be effective means to avoid the ban.
I can never call what supposed to be human freedom that the government are againsting humans for to be seen as illegal, the government too can do something wrong, making their citizens to more succumb to their ways of not given citizens the freedom that they want.
It is seems that your country does not support the gambling if they make this as a law I guess it is just good you will follow these because for sure there's a section for those people does not obey the rules and next is if you really urge to play it is more ideal to do is make a non detected device like use of the VPN because you are the responsible with your actions.
Some gambling sites do not accept VPN in a way it would be blocked, some will accept it for bypassing but against the gambling site rules. Some gambling sites can block the account of a gambler because of VPN. The best that I think is that the government should allow gambling. This would protect their citizens from a lot of things that might arise if the gambling site wants to cheat them rather than staying mute when they were cheated by the gambling site. There is more risk involved if the citizens are not allowed to gamble.
It is also good to read the ToS of a gambling site cornering the use of VPN before you make use of the gambling site. But VPN is not advisable.