You can just make a lambda function to represent your mean in a compact way.
lambda X: a + b[0]*M + b[1]*G
The only downside is that you would lose the semantics to combine mean functions to form a new one. As that is not your concern for now, I think a lambda function should work just fine.