I'm pretty sure there's no law (but the habit is genuine). I cannot find a definitive answer, but since it's difficult to prove a negative, I'm going to offer some fairly strong evidence.
- None of the search hits for
site:legifrance.gouv.fr croissant beurre on Google (1 2 3 4 5 6 7 8 9 10 11 12 13
14) mention such a law¹. Légifrance is a French government website that indexes all laws and contains the full text of all laws passed since the web era. This is not definitive because Google may have missed a page, and there could be an old law that's still on the books but hasn't been scanned yet.
- One website claims that the shape differentiation is mandated by law and cites the “Décret Pain” as the law in question. But in fact the Décret Pain does not mention croissants at all, it only regulates what can be sold under a name that uses the word “pain” (bread) with certain specific qualifiers.
- A 2017 newspaper article relates a campaign to regulate the appellation “croissant” in the same way that “pain” is regulated, which implies that there is currently no such regulation regarding croissants.
It may not be a law, but it certainly is a widespread habit to make croissants au beurre (croissant made with butter) straight or nearly straight, and croissants ordinaries (croissants made with margarine) curved in the shape that gave the pastry its name. This is mentioned in a newspaper article and two courses for bakers, with no claim that this is regulated by more than habit:
[After World War I, the croissant gradually became accessible to less wealthy classes.] Rich people will have butter croissants — in an elongated shape — while the “money-light” will have to make do with curved margarine croissants. (Le Monde, “Les Mystères du croissant”, 2005)
Then curve the croissant if you used margarine, and leave it straight if you used butter. Le façonnage des croissants, in Conseils CAP pâtisserie, Grégory
Since margarine was invented a century later than the introduction of the croissant in France, the butter croissant is the one that was originally curved. One can imagine that the looks were swapped, since in business there are more sales of butter croissants than of ordinary croissants. Indeed it is faster and more cost-effective to make straight croissants and store them in a freezer than it would be with a moon-shaped croissant. La Viennoiserie, in Technologie boulangerie CAP, D. Guedes
And just to show that it isn't a universal rule, here's a bakery website showing a curved butter croissant and a straight margarine croissant. For all I know they swapped the pictures by mistake, but it shows that it isn't such an ingrained habit in France that anybody would spot the inversion instantly.
¹ Note that “croissant” in French can also mean “increasing” or “ascending” as in sorted in ascending order, which explains why so many pages on this .