Some of that loss is from dehydration.
I have NO desire to get a stomach bug to lose weight. Last year I was traveling in Peru and had a 24 hour stomach bug that had me throwing up everything (including water) I ingested. It started one night in Cuzco. The next morning I had an 8 hour tourist bus trip to Puno with stops along the way. Despite Phenergan I could not drink so much as a sip of water without throwing up. It was an awful day. I didn't even get out of the bus at the last two stops and everyone on the bus through I had altitude sickness. I did not have altitude sickness as I had been at altitude for a week already and hadn't been sick!
When we got to Puno, I crashed and managed to sleep all night. The next day, we had a boat tour on Lake Titicaca, to the floating islands and Taquile Island. I had not been able to keep any food/liquids down at this point for 48 hours, but was feeling better and didn't want to miss the floating islands. So I went on the trip.
Well, the floating islands were amazing and I was now keeping down a few sips of water. Then, we went to Taquile Island. Our tour director said that the hike we had would be easier than anything we'd done in Cuzco.
He was so wrong. It was a 2.5 mile hike uphill at the highest altitude we'd been to. All uphill, often very steeply. I was so weak from the virus it was really tough. Luckily there was a little stand at the beginning of the hike where I was able to buy some PowerAid and a quinoa-based 'granola' bar, because I really, really needed the fuel.
The scenery was gorgeous and they had a lunch of trout fresh from the lake for us but I couldn't eat much.
The worst part is that I gave the virus to several of my traveling companions, although they were lucky enough to get it while in Lima when they could spend a day sleeping in the hotel.
But! Keep your calories reasonable and ease back into foods. Don't stress your system too much and drink plenty of water and broth.