when you need GC to train etc, sure those peons need homes. but once war comes they can gtfo! raze the homes into hosps,rax,tg,stable, etc... reduce ur wages to 50% and make friends with someone who will feed you wages when you armies are coming home...
razing too much homes can put you into overpop and stop you from attacking. to avoid this (assuming you wanted to attack same tick) the most you can raze is 37.5% homes without going over 115% overpopulated(the point where ur army refuse to march, and begin to desert)... generally you would do this 12h(or whatever ur build time is) before war, and you would have that much time for peons to leave and drop your pop back under 115%