Ermm - could it possibly be, just possibly, mind, the process known as... evolution? That process that bearded fella talked about - Darwin? Why, yes it can.
I have no idea where you have gained the impression that evolution imposes any sort of cap on the numbers of genes that are "allowed" to mutate - but your impression is wrong.
Then you have the fact that each "generation" lasts maybe a few hours - a day perhaps? And you can have thmdreds of generations every few weeks/months, with each generation having the potential to offer all sorts of novel genetic variations. You also start from a position of having many serotypes ( 700 or more?) of E.Coli, All of which can combine with each other, given proximity and time.
All of which means we as a species have been very lucky in avoiding some truly nasty pandemic virus or bacterium over the years.