Tesla CEO Elon Musk just struck an astronomical deal for $2.6 billion (yes, with a “b”) in pay. Good for him — but it’s worth noting that New York taxpayers have helped fund a hefty chunk of this biggest-ever corporate compensation package.

We’re thinking of the $750 million in public funds that Gov. Andrew Cuomo has shelled out as part of his Buffalo Billion (now Billion-and-a-Half) program to build a factory and infrastructure for solar panel maker SolarCity — which was headed to bankruptcy until Tesla acquired it.

You paid for Tesla’s factory — saving the electric car company the cost. And now Tesla can use those savings to help cover Musk’s deal.

It’s a stomach-turning thought: New York taxpayers are being fleeced to help pay billions to a man already worth an estimated $20 billion. It should send shivers up the spine of every single one of the state’s 19.9 million residents.

Worse, Cuomo’s promised “return on investment” on that $750 million — thousands of jobs for economically ailing Buffalo — has yet to materialize.

The plant, which began operating last year, now employs just a few hundred workers, and its future remains uncertain. Indeed, the Buffalo area actually lost nearly 5,000 jobs between December 2016 and December 2017.

Meanwhile, Cuomo’s Buffalo Billion did generate a whole mountain of corruption: His former top aide, Joe Percoco, was convicted just this month. Another key player, SUNY Polytechnic honcho Alain Kaloyeros, faces trial in June.

True, Musk will only collect his full $2.6 billion (in the form of stock options) if Tesla hits growth targets, and some are quite ambitious. But under the terms of the deal, he could actually earn as much as $55 billion (about 1 million times as much as a starting teacher’s annual salary) if the firm meets all the goals.

And if Tesla does well enough to pay him that much, why would it need a $750 million handout from New York taxpayers?

Alas, this is Cuomo’s sorry approach to economic development in New York: Bathe favored industries in taxpayer cash but ban a terrific source of new upstate jobs, fracking (even as the rest of the nation thrives from it). Push through sky-high minimum wage laws that make it too expensive to hire new workers and keep taxes in the stratosphere, discouraging wealthy job creators. (He’s now moving to hike taxes again this year.)

No wonder the upstate region has seen little growth — and even job losses. No wonder its share of the state’s population continues to plummet, as a new City Planning analysis of census data shows.

What a tragic bottom line: New York suffers while the billionaires grow richer.