score:31
tl;dr: No, at least not in the sense suggested.
The earliest source of something akin to this story, seems to be the 1584 Historie of Cambria, now called Wales, the first printed history of Wales. The author, a Welsh cleric called David Powel, wrote that:
He called the Welshmen togither, declaring unto them, that whereas they were oftentimes suters unto him to appoint them a Prince, he now having occasion to depart out of the countrie, would name them a Prince, if they would allow and obey him whom he should name. To the which motion they answered that they would so doo, if he would appoint one of their owne nation to be their Prince: whereunto the king replied, that he would name one that was borne in Wales, and could speake never a word of English, whose life and conversation no man was able to staine. And when they all had granted that such a one they would obey, he named his owne sonne Edward borne in Caernarvon castell a few daies before.
While this is clearly trickery, given that this account was written three centuries after the events in question, it is generally not considered credible.
Moreover, even in Powel's version, there is no mention of any peace settlement that may necessitate such trickery. Indeed, there was in fact no peace settlement in that war: Edward brutally executed Llywelyn's successor Dafydd, imprisoned most of their relatives for life, and generally went out of his way to destroy the ancient House of Aberffraw. It was a war of conquest and annexation.
In conclusion, there is no evidence to corroborate the specific version of events, as the story described in the question. Nonetheless, the idea that Edward might have thought to use his son's birth in Wales for political capital is not farfetched.
Upvote:5
It does seem to be a myth, but one that's been around for a few hundred years. This is briefly discussed in the Wikipedia article for Edward II, which notes:
David Powel, a 16th-century clergyman, suggested that the baby was offered to the Welsh as a prince "that was borne in Wales and could speake never a word of English", but there is no evidence to support this account.[15]
Sadly the article doesn't go into any detail about this, but it does suggest the sources dismiss it conclusively. The citation here is to two recent academic-press biographies of Edward II (Seymour Phillips, 2011, and Roy Haines, 2003).
Powel's version of the myth can be seen in this 1811 edition of Historie of Cambria. It's not clear exactly where he took it from; this particular section was "collected for the most part out of the records in the Tower", rather than being attributed to Cronica Walliae or other Welsh sources.
Interestingly, the same book seems to be responsible for popularising another common myth - that of the Welsh discovery of America by Madoc in the twelfth century.