My belief is that most likely, the smartest person who ever existed is someone who is unknown to history, at least in 2023. Most likely they were never known to history at all, but if they were, they are likely someone whose existence has been forgotten.
Why? The law of averages. Today, most countries have at least primary, and in many cases secondary, education provided free of charge to everyone, although quality can vary. But that's a pretty recent phenomenon, even in the most developed parts of the world. It was not common in the 1800s, let alone the 1300s.
So, most likely the smartest person who ever existed never had any good opportunities for education. They worked as a blacksmith producing higher-quality goods than the smiths in the next villages over, or were a serf who made keen observations about irrigation techniques. I'm reminded of
Edmond Albius, who figured out how to artificially pollinate vanilla as a slave in Madagascar. He's probably not the smartest person ever, but he's a good example of someone whose potentially was likely much higher than their social status allowed them to demonstrate.
Or perhaps they played an important role in a part of humanity's past that is lost to history. Developing agriculture or early legal codes in the Indus Valley or Mesopotamia. We know of Sargon of Akkad and Hammurabi, but how many exceptionally intelligent people must have been involved in that stage of human history, prior to the development of writing, or at a time when unless your deeds were literally carved in stone, they wouldn't survive to the present?
For that matter, the people who invented various forms of writing must have been pretty smart people.
It's also entirely possible that the smartest person ever lived even farther back in time than that. If they lived 30,000 years ago, we'd never know of them. We tend to assume that people today are smarter than people 30,000 years ago, but considering that well over 90% of human history is before written human history, I wouldn't be surprised if there were an outlier before written history who would technically be the smartest ever.