Fascinating if quite tragic history. It's probably worth noting that sexual offenses like buggery were left out of the Napoleonic law codes not because French society tolerated gay men, but because the French deliberately left such matters to the tender mercies of the Roman Catholic Church, which for most people quite dominated daily life. Being openly gay at that time was no more possible in France than in England. The Church imposed severe consequences for homosexual behavior, though I don't believe they went so far as hanging people.
Gay exiles to France, like Oscar Wilde in a later era, could live free of fear of the law, but could never be truy accepted in society.
By the way, I don't know if you've seen the news, but a report has emerged that as recently as the 1990s, U.K. military authorities subjected gay men to electrocution and other barbaric practices.
Inexplicably, and even though a former U.K. government commissioned the report, the current U.K. government is said to be maneuvering to delay or stop publication of the report.