I’m not even certain that Muhammad was really illiterate.
According to Muslims, he was being raised by his uncle, he traveled as a merchant, delivering supplies to various communities.
He also traveled extensively with his first wife Khadijah, who hired him to help her with her trade business.
Surely there must have been some sort of written record kept to document these transactions. The merchant trade cannot exist without written records of what and how much was shipped to whom.
“Those who follow the messenger, the Prophet who can neither read nor write, whom they will find described in the Torah and the Gospel (which are) with them......”Quran 7:157.