Airside is closed overnight and security opens at around 04.30 (or did when I was there in February) with the cafes etc opening at about 5 (IIRC the WH Smith was open when I got airside just after 04.30)
If you have lounge access they start opening at 5am
from the LHR website there is a 24 hour costa coffee open landslide so I’d assume that landslide is open through the night.
personally I’d be looking for a hotel rather than lurking in the terminal for that length of time. As NWIflyer stats there are plenty of hotels in the area and if your flight arrives at 10pm you’d likely be in bed by 11