I usually end up doing an M&S food shop at T5 (including connections) and don't have any issues with security. I just keep it all in the M&S bag and it's fine (and of course - get the food after you have checked in - that way you avoid the hand baggage limit!).
The only issue I have ever had was explaining things to US customs - 'mince pies' - oh.... .