The M functions are the MacMahon’s partition functions (see the paper [1]). They were not known to relate to the sum of divisors. The M_a function counts partitions in a parts but weighing multiplicities in the partion.
As for the higher ones, I'm having trouble finding a proper citation saying that this was known earlier, but this math.stackexchange answer asserts that MacMahon himself worked some of this out: https://math.stackexchange.com/a/4922496/2884 No proper citation though, annoying.
When you say "this wasn't known", on what basis is that? It's very hard to be sure that something wasn't known unless you're an expert on that particular thing!
M_1(n) = sum(
m
for m in range(1, n+1)
for s in range(1, n+1)
if m*s = n
)