Mario was born as “Jumpman” in 1981 for the game Donkey Kong. After being featured in several more arcade games, Mario became famous for staring in Super Mario Bros on the Nintendo Entertainment System, and went on to become the most recognized video game character in History.
Mario’s creator, Shigero Miyamoto, was limited by hardware capabilities at the time and those dictated the original designs. His mustache helps seperate his nose from his face and isn't as fine as a mouth. His overalls help show his arms passing in front of his body. Miyamoto gave him a hat because hair would be too much detail on such a little guy.