Actually I don't think weight gain is a given.
Your metabolism is slowed down with carbs because insulin is what prevents you from accessing the fat stores. Fasting get rid of insulin and when there is no insulin you can burn all the fat you have. So when you start eating again if you eat low carb and high fat, you'd be burning fat all the time, dietary when you eat and on board fat when you dont.
I messed up a bit with that and ate a lot of carbs and got metabolism lowered.
Thanks.
Srinath.