The past couple of years have seen much to-ing and fro-ing and speculation as to whether Canon would abandon its EOS-M line of cameras. The steady shift towards the mirrorless R series seemed to strike a death knell for the smaller, older system.
But Canon staunchly denied such speculation. In March 2023. Canon even went as far as confirming that they were still invested in the M system, saying, “We will continue to offer the EOS M series as we need to meet this high demand.”
Apparently, stocks of EOS-M lenses are in short supply, so if you have the M system and still want to invest in new glass, now might be the time to jump on it. Otherwise, second-hand will be the only other option for Canon-made lenses. You can also still get Sigma and Viltrox lenses for the EOS-M system, at least for now.