The number of the cells required for supplying power to an embedded system
The ESR of frozen electrolytic capacitors goes through the roof, if you have any in your design, please check for potential problems.

Whether any of the components in a Raspberry Pi is actually rated for -40°C (most likely none) is your problem. Considering the price of a rPi, I would buy some extra, freeze them, and keep the ones which still work.

The battery works much better warm than frozen.

I'm not gonna do the math for this, but I would consider putting the device, or at least the battery, inside an insulated enclosure, 5cm thick PIR foam for example. We will assume whoever puts it down outside in -40°C weather got there in a nice comfortable heated car, so the device can be warm inside when it starts. You only want 4 hours runtime, which is quite low.

You could even go:

"Dear customer, we can sell you the $200 battery which works at -40°C, or you could crack a handwarmer, throw it in the enclosure and close the lid, and in this case the $5 battery will give you the same runtime."