It seems highly likely that the members of Monty Python were familiar with Ben Jonson's great comedy, The Alchemist (1612), which begins (Act I, Scene 1) with this exchange between Face (a servant overseeing his master's property while the master is away on a lengthy trip) and Subtle (a con man who poses as an alchemist):
Face. Believe't, I will.
Subtle. Thy worst. I fart at thee.
I have no doubt that the similar instance in Monty Python and the Holy Grail is essentially an updating, an homage, and a sillification of that opening retort in Jonson's play.
The repercussions of farting in someone's general direction are recorded in Thomas Cox, A Topographical, Ecclesiastical, and Natural History of Oxfordshire (1700):
In his March, he [William of Normandy] heard that this City of Oxford had rebelled against him, which obliged him to go a little out of his way to still them ; when he came thither, he found the Citizens resolved to defend themselves, being environed with a strong Wall ; whereupon he having no Way to gin it but by a Siege, he took a View of it round, in order to his attacking of it. In his Way one of the besieged got upon the Walls, and pulling down his Breeches let a Fart at him, which when he was informed of, he burst out into a Passion, and swore, he would avenge the Affront, which he soon did ; for he took it at the first Attack, and left it to be harassed and plundered by his Soldiers, who slew not only many Citizens, but Academicks ; yet the present Sufferings were not the sole bad Effects of the Rebellion.
And from the entry for October 14, 1608, in G.B. Harrison, Journal for 1608, reprinted in Report on the Manuscripts of the Marquess of Downshire, Preserved at Easthampstead Park, Berks: Papers of William Trumbull, the elder, 1605-1610 (1936) [combined snippets]:
At that Captain Bruz turned back, and Sir T. Studder asked him whether he had no better manners, whereunto Captain Bruz answered that he was as good a man as Studder and had no cap for any men but those whom he liked. And then that Studder replied that my Lord Ambassador was angry with Sir Edmond Bainham because he would not put off his hat to him, and that there was almost as much difference between himself and Captn. Bruz as between my Lord Ambr. and Sir Edmond Bainham, and hereupon lifting up his leg, let a fart at him and bid him carry that in his teeth to his companions.
There thus appears to have been a lively but imperfectly remembered tradition of insult farting in English history, between the Conquest and the early 1600s.
Scotland is represented, too, in James Kelly, Complete Collection of Scottish Proverbs (1721):
Titt for tatt, quoth the Wife when she farted at the Thunder.
A sens[e]less Proverb spoken when we give as good as we get.
Monty Python follow in this distinguished line of directed farting and undoubtedly deserve credit for the "in your general direction" refinement of the old insult.