Is a comma required here?

Solution 1:

The fashion for the last several decades is to use less and lighter punctuation. As there is no danger of misunderstanding the elements of the sentence without the comma, leaving it out is preferred. If one were to read the short sentence aloud there would be no need for even a short pause.

Solution 2:

It is fine with or without it; it's more a case of how you want people to read it.

Personally, I would add it because I prefer the pause between the two main parts of the sentence, "During the war" and "David was a pilot.

Solution 3:

It's generally good practice to distinguish between extra information (specifically that this is "during the war"), and the main point of the sentence (that David was an RAF pilot).

Thus:

"During the war, David was a pilot in the RAF."