Yes. A long fast can reduce overgrowth of harmful bacteria that survives on a continuous supply of food. This paper mentions Morganella morganii, which is an example of harmful bacteria that thrives in a environment full of undigested proteins and carbohydrates.