If you correct heading for drift to maintain the track line, you will have a permanent headwind component and get there slower.
That's true, but if you fly a constant heading all the way you will end up flying for longer, because the wind blows you increasingly off track on the first leg, and the second leg does not compensate for that; it merely puts you back where you should be, after having spent more time in the air.
The answer to this puzzle will be interesting.
A google finds e.g.
this which makes sense but I am not sure it is applicable to the question as originally posted, which is a different scenario. It is obvious that if you are crossing a high or a low then flying to one side of it will help pick up a bit of tailwind.