Squatting in residences that are actually occupied by someone is vanishingly rare. This bit of legislation was just a bit of Tory chest-thumping based on apocryphal tales designed to scare their owner-occupier voting base.
Ideally councils would be much quicker to seize abandoned homes and return them to use, making squatting them unnecessary. But they won’t.
I don’t know which jurisdiction you’re in but, while it isn’t illegal in the UK, you’re absolutely right about it being a bad idea and you are correct about the reason. In the event of a crash, it could count against you (in the UK, at least).