A bad thermostat or temp sensor won’t directly trip a fault code. Unless it causes misfiring, or an out-of-range oxygen content in the upstream oxygen sensor, it’ll generally not cause a code. The ECU doesn’t monitor the T-stat directly. A defective T-stat can, however, cause the engine to take too long to reach operating temperature and kill gas mileage. But that would be highly unusual. Usually they fail by either not opening, which will cause overheating, or not closing, which would have rendered your heating system’s marginally operative at best.
Your symptoms don’t sound like a bad T-stat, but I thought I’d add a bit of clarity on the T-stat question. It remains a possibility.
My wild guess would have been driving style, but your mileage with the loaner would seem to rule that out.
Re: the measuring question, the only accurate method of measuring mileage is to divide the fuel pumped to “shutoff” at three or more fillups into the miles traveled, preferably using the same pump every time to reduce the shutoff point as a variable. The key is to use some method such as mile markers or known distances as variables. Gas pumps are calibrated, so you can rely on their accuracy, but your odometer could be off.
Of course, tying a moose to your hood would make your gas mileage drop too.
Just trying to add a bit of levity. No offense meant.