The law (from the early 19th century) said that names for newborns should either be chosen in the calendars (plural, no religion mentioned) or from known people in history. So from the beginning, Mohammed was an acceptable name for instance.
A law from 1966 recognized that this was vague and not really applied, as usage varied (basically it was just used to deny too harmful names to kids) and decided to give a broader definition, allowing explicitly names from mythology, regional names, composed names, variation and abbreviated versions.
In 1981 the sole interdiction was to choose a name that "would not be judged ridiculous".
The 1993 version changes even that and says (more appropriately IMO) that the officer registering the names can delay the thing, if he judges that the choice of name is contrary to "the interest of the child". A judge then has to decide or deny. I remember a case involving a «Pikachu», a «Satan» and, I think, a «Jihad».
Names like Anakin or Gandalf were likely acceptable even under the 1966 law.
https://www.amazon.com/Seeing-like-State-Certain-Condition/d...
Actually this office is widely criticized to propose absurd job offers to candidates as they are pressured to remove candidates from benefits lists, either by finding them a job (rare) or by having them refuse two jobs in a row (more common).
Their scenario was really not that implausible.