In Jakob Emanuel Handmann's 1753 portrait of Leonhard Euler, often used as the defining image of the mathematician when modern articles need to show him, Euler is portrayed with what appears to be a improvised headwrap or turban.
Is this intended to be the historical national dress of some group, as is the case with Allen Ramsay's 1766 portrait of Rousseau, where he's in Armenian dress? Or is there a political overtone, as in Benjamin Franklin's New World fur hat he's depicted in the famous 1777 engraving?
Really, maybe the question should be, why were 18th century intellectual figures often portrayed wearing seemingly unusual hats? Did salons have "weird hat" parties?
Not really an answer to your question, but further information about Euler. You will find Euler in different headgear in different portraits. See: http://eulerarchive.maa.org/portraits/portraits.html
The earliest portrait is Sokolov's 1737 mezzotint - here Euler is seen wearing a wig.
For the other portraits, the following descriptions are given by Florence Fasanelli in the chapter "Images of Euler" in Leonhard Euler: Life, Work and Legacy.
Handmann's pastel painting of 1753 (the one you asked about) - "He wears an ultramarine blue silk robe with black stripes and buttons, and wound around his head a loose blue and white silk cloth (as was the custom since he is not wearing a wig and his head is shaved)."
Handmann's oil painting of 1756 - "In this picture Euler is portrayed wearing a bag wig tied with a black ribbon. This style was customary for fashionable men from the 1660s to the later 18th century for those who could afford this expensive item of personal grooming. Wigs required considerable upkeep as well: a barber to shave the head and to powder the wig, which was replaced or restyled every year."
Darbes' painting of 1778 - "Here, Euler, pictured at age 71, no longer wears the formal clothes shown in the earlier portraits. His large hat and the fur collar on the coat were intended to keep the sitter warm."
So, at least partially, there would have been practical reasons for wearing a certain kind of hat. Unfortunately, this doesn't explain why Euler chose not to wear a wig in the 1753 portrait. Euler was at the Berlin Academy between 1741 and 1766, and could surely have afforded a wig in 1753 just as well as in 1756.
This may not be too level material; however, I'm also curious on the origin of that style since David Hume wears a similar hat in a portrait. I've tried googling but cannot find much.