I'd recommend https://github.com/tpope/vim-commentary for commenting out code. Anyway, it's not a good practice.
Optionally, convert the region into a separate function/method and just don't call it while checking.
#if 0
...code...
#endifhttps://github.com/Jaymon/vim-commentify
It's a no frills plugin that only does one thing, but it does it pretty well.