I always thought it came from the Japanese school rating system, where the concept was transferred to the west through the medium of games. I was under the impression that this system preceded the creation of video games but I can not find a reference for that.
In Japan the "S" is explained as shū (秀) "Exemplary, excellent".
https://en.wikipedia.org/wiki/Academic_grading_in_Japan
https://en.wikipedia.org/wiki/Academic_grading_in_the_United...