There are several aspects of the rules around marriage in France that would make your plan difficult. As far as I know, it's not forbidden to marry as a non-resident but the law is clearly not intended to make it easy.
- You need to complete some formalities beforehand (publication des bans). It should happen at least 10 days before the wedding but you also need to allow some time for the municipality to process the paperwork and find a slot for you, so realistically we are talking about weeks rather than days.
- By law, the marriage should be celebrated at the town hall. There are a number of exceptions defined in the law (e.g. if one of the future spouses is dying or too sick to move) but the town is not allowed to let you marry anywhere else without a good reason (and even then they have to inform the procureur, who is a bit like a state's attorney/chief prosecutor).
- You need to have a “link” with the municipality. Usually, this means the place of residence of one of the spouses but some family or property can also be deemed enough so with the right connections you might be able to go around this requirement (in practice it's up to the mayor). But you can't just pick a town and get married there.
- Depending on their citizenship, there are additional requirements for foreigners, typically some document from your country of origin certifying that you are able to marry and a certificat de coutume (an affidavit of law explaining the rules pertaining to marriage in your country).
For same-sex marriage, there is an additional restriction based on international agreements. It's simply impossible for citizens of Algeria, Bosnia-Herzegovina, Cambodia, Kosovo, Laos, Morocco, Montenegro, Poland, Serbia, Slovenia, and Tunisia to enter a same-sex marriage in France.