Leave it running.
If it’s that cold there, there might be engine block heaters scattered about? I know Fairbanks has them.
Run the preheater or glow plugs, depending on your model, numerous times (3 or 4) before attempting to start...good luck. Otherwise, go and start it every few hours and allow it to warm up.
Well for me my wife blowning in my ear usualy works. ;-)
Leave it running. Might also find some cardboard and cover the grill. Your biggest problem is going to be a fuel fikter full of green jello. 40 below is ugly....red
I think I’d leave it running.
Take the battery indoors with you. Keep in mind that a freezing cold battery has less than half the cranking power. A full tank of #1, plus a warm battery may make all the difference you’ll need.
At those temps, fuel gelling may be a bigger problem than starting unless your truck has a fuel heater for the filter.
If you can, the only real advantage you can give yourself would be to bring the battery (ies) inside overnight.
Only problem with that is removing batteries will usually effect the radio among possible other electric components which would then need to be reset.
Check your owner’s manual if the car is new for instructions on extended idling, and follow them when you let it run all night. I know my semi requires me to run a couple of hundred RPMs higher than idle for long periods.
If you can’t find a heat source letting it run is best.
If the Shell local blend is done right it should work. There are specific winter blends of diesel that are good, one example being Flint Hills’ Arctic Diesel (that particular brand is in the upper Midwest).

Better yet, travel to kinder climes.
How much does an oil pan heater cost (and how well do they work) - I'm not sure my gasoline engine would be happy trying to start in -40 (it would need someone to sub form because my tush ain't hitting that cold a seat).
Hope someone else has more useful stuff to say.
Head to the local hardware store for a long outdoor extension cord and a 100 watt trouble light. Plug it in. Turn it on. Place under the hood next to the engine block, and close her up. Should provide just enough heat to stave off problems in the morning.
(Old timers used to make these, warm them by the fire or wood stove, and take them to bed with them to stay warm at night)
Where in the world will you be for it to get to -40? You gonna drive to antartica to rescue those dimwits?
Buy a couple cases of beer. In case your truck does not start, drink the beer.
This is entirely out of my range of experiences, but perhaps a trip to the local pub and a plea for advice over a scotch with a local patron might reveal the answer to the problem. That’s what I’d do.
well... you could do like i read the Germans did on the eastern front during the war when it got to -40 in that they drained the diesel fuel and crankcase oil out of their tanks at night and kept it warm but it's prolly easier finding a heated dipstick or keeping it running all night 8^)
If the vehicle is parked in a garage I would find an unused electric heating pad and place that in the engine compartment.
I think that would do the trick if your minus a block heater.
You shouldn’t have to set the temp up too high either.