It appears that this is now possible via the Power Query SDK.
This has enabled projects such as PowerQueryNet, which can already execute the M PowerQuery expressions programmatically.
Although you should keep in mind that the magic of PowerQueryNet is achieved through the use of undocumented APIs and in a commercial setup, may violate the Power BI / Power Query EULA. So tread with caution.
I'm currently working to put this into a docker container which receives M via REST and returns data in the format requested (JSON/CSV/XML).
If anything, all of this shows how easy it would be for Microsoft to satisfy this request. It's also an interesting insight into how under funded Microsoft software development might be, or how little Microsoft they realize the value of Power BI / Power Query: it enables savvy business users who know their data best to do hefty data transformations with Office apps already installed on their computers - a massive step forward.