Anecdotally, working in Maharashtra with Indians in an Indian company for a few months I was never ill. This was eating $1 "luxury" 8 course meals brought to me in the morning by a dabbawalla on his motorbike which - as with all my co-workers' food - stayed out in the searing heat for a few hours before lunch; I also eventually had him bring me dinner. I lived in the same company housing as everybody else. No idea how you'd find a dabbawalla though, I just took the stack of leaflets dropped at the office and tried them all until I found a good one.
Coming back for 2 weeks to Mumbai, Delhi, Pune, Bangalore staying at a famous and very nice 5 star hotel chain and eating only in their restaurants, I caught the worst bout of my life. Bit wary of hotel kitchens since then.
I met a seed-stage startup person who has this setup (somewhere in India) while traveling through a hostel in SF recently. Two meals cooked per day and cleaning. It sounded like a great setup and much more affordable than what that would cost in the US.
The hotels that cater to Westerners typically charge a lot more, and rates are more comparable to hotels in a cheap European city. Theoretically, with them you get a guarantee of food that is prepared with better safety standards. Whether this is practically true I have no idea.
Ironically, the cheapest way to live and eat in India would be to rent an apartment and get a trustworthy cook to come in and cook fresh food for you every day. Your daily bill will be way less than $20. However, setting this up requires a fair amount of legwork and contacts, which (understandably) someone who is looking for a vacation will not find attractive.