Tesla CEO Elon Musk gestures as he visits the construction site of Tesla’s Gigafactory in Gruenheide near Berlin, Germany, August 13, 2021.Patrick Pleul | ReutersElon Musk has told his tens of millions of social media followers that he “would prefer to stay out of politics.”Yet, with a mix of trash talk and big spending, the multibillionaire mogul behind Tesla and SpaceX has become a political force.Musk himself has personally taken shots at politicians and government regulators, including digs at President Joe Biden and a recent sexually tinged insult aimed at a U.S. senator. Behind the scenes, Musk and his biggest companies, SpaceX and Tesla, have for years worked to influence the U.S. political landscape, including through lobbying and political donations. Combined, SpaceX and Tesla have spent over $2 million on lobbying this year.Musk has also recently vocally opposed Biden’s support for organized labor. In particular, he objects to a tax credit proposal that would give a $4,500 discount to consumers buying electric vehicles made by unionized autoworkers, giving Big Three automakers an edge over Tesla, Toyota and others.Musk has also ranted against a proposed billionaire’s income tax, accused federal vehicle safety regulators of anti-Tesla bias, and upbraided the Federal Aviation Administration for having a “fundamentally broken regulatory structure,” in his view.His companies have put their money to work to influence the government in other ways. During the third quarter, which spanned from July through September, Tesla and SpaceX both lobbied Biden’s White House and other parts of his administration, according to recent disclosures.Musk’s aerospace company, SpaceX, has spent just under $1.8 million this year alone on lobbying, after spending over $2 million last year, according to data from the nonpartisan Center for Responsive Politics.Tesla, the electric car and renewable energy company he runs, has spent over $400,000 on federal lobbying this year through September, already more than it spent in the entirety of last year.By way of comparison, Ford has spent $2.6 million on lobbying this year. (The company sells millions of vehicles annually, while Tesla has not yet surpassed 1 million deliveries in a single year.) Jeff Bezos’ aerospace venture, Blue Origin, has spent around $1.4 million on lobbying so far this year.Musk, Tesla, SpaceX and the White House did not return requests for comment for this story.Working with both sidesEven when he avoids commenting on a hot button issue, such as Texas’ restrictive abortion law, Musk makes political waves.”In general, I believe government should rarely impose its will upon the people, and, when doing so, should aspire to maximize their cumulative happiness,” Musk told CNBC in a September tweet responding to a question about the Texas law. “That said, I would prefer to stay out of politics.” Musk’s companies and private foundation are growing their operations substantially in Texas.Musk hasn’t been shy about backing certain candidates, either.In 2020, Musk verbally endorsed Andrew Yang as a Democratic candidate for president, based on Yang’s support of a universal basic income. He also called California’s coronavirus stay at home orders “fascist” and famously kept Tesla’s Fremont, California, factory running for weeks, openly defying the orders.During that time, he tweeted “Take the red pill,” including a red rose emoji with the tweet. The “red pill” is a symbol from “The Matrix” co-opted by right wing extremists and others, while the red rose is a symbol used by the Democratic Socialists of America.Musk has regularly contributed to candidates of both parties, too, according to data from the Center for Responsive Politics that dates back to about 2002 (see chart below). Other business leaders such as longtime investors Nelson Peltz and Leon Cooperman employ the same bipartisan giving strategy.Musk has contributed to a wide variety of campaigns, with the most recent Federal Election Commission filings showing he gave to the Republican National Committee. Those individual contributions do not include the SpaceX political action committee’s $210,000-plus in campaign contributions to congressional candidates from both sides of the aisle during the first half of 2021.Musk, historically, has contributed slightly more to Democrats and their causes, according to data from the nonpartisan Center for Responsive Politics. In the previous 2020 election cycle, Musk contributed to Sens. Chris Coons, D-Del., Jeanne Shaheen, D-N.H., Jack Reed, D-R.I., and Gary Peters, D-Mich. He also gave to Sens. John Cornyn, R-Texas, and Thom Tillis, R-N.C.Musk’s companies also rely on lobbyists with links to both major parties.Recently, Tesla and SpaceX hired at least two new lobbyists that have prior experience working on Capitol Hill.Jonathan Carter, who was a legislative aide to Sen. Richard Blumenthal, D-Conn., became a policy advisor to Tesla in April, according to his LinkedIn page. Carter was a “lead staff member to Senator Blumenthal on Auto Safety, Census, Small Business, Sports, and Trade issues,” his profile says.Blumenthal is a member of the Commerce, Science and Transportation committee, which has jurisdiction over highway safety, transportation and nonmilitary aeronautical and space science, among other items that impact Tesla’s business.Blumenthal has publicly taken aim at Tesla’s driver assistance systems, marketed as Autopilot and Full Self-Driving software. In a tweet in September, Blumenthal said using this technology was a form of “Russian Roulette” for drivers.Carter was among a group of Tesla lobbyists that in the third quarter lobbied Biden’s White House, the Departments of Energy and Transportation, the Environmental Protection Agency, the Office of Management and Budget and the Department of Commerce. Carter’s team also engaged with House and Senate lawmakers last quarter.A disclosure report shows that the lobbying effort by Tesla focused on a variety of issues, including solar permitting, autonomous vehicle related policies, infrastructure, the Highway Trust Fund and EV charging.Meanwhile, over that same time period, Musk suggested at a conference in late September that he and Tesla were being treated unfairly because they weren’t invited to an electric vehicle summit at the White House.”Does this sound maybe a little biased or something? And you know, just — it’s not the friendliest administration. Seems to be controlled by unions, as far as I can tell,” Musk said at the time. The White House summit was in August.His space company in the third quarter also recently hired at least one former aide to a powerful senator and has engaged directly with Biden’s administration, including the White House.Joseph Petrzelka, who was an aide to Sen. Dianne Feinstein, D-Calif., for over four years, became a global government affairs manager for SpaceX in September, according to his LinkedIn page. Feinstein is a member of the transportation, housing and urban development subcommittee, which is under the Senate Appropriations Committee. Their jurisdiction covers the Department of Transportation.Though Petrzelka is not listed on SpaceX’s third quarter report, the company spent $590,000 directly lobbying lawmakers, including Biden’s Executive Office of the President, Department of Defense, the National Aeronautics & Space Administration, the Department of Transportation, the National Security Council and the Federal Aviation Administration. NASA certified SpaceX in November 2020 to carry astronauts to-and-from orbit. SpaceX also lobbied members of Congress.For its part, SpaceX has notched federal contracts worth a total of about $10.5 billion since 2003, most of that from its work with NASA. In 2021, those contracts have amounted to around $2 billion with $1.6 billion of that from NASA, according to data tracked by GovWin that was viewed by CNBC.SpaceX is going through a tense, environmental review process that will determine whether they can start building out and launching their Starship vehicle from a site in Boca Chica, Texas, or whether they need to complete a more formal assessment that could cost them years.The over $500,000 paid by SpaceX last quarter for lobbying does not include separate fees paid to outside government influencers.SpaceX paid $90,000 in the third quarter to Invariant, which was founded by longtime lobbyist Heather Podesta, to lobby the Executive Office of the President, the Department of Transportation and Department of Interior, according to the latest disclosure report. Podesta, who has raised campaign money for Democrats for well over a decade, is one of the Invariant lobbyists engaging lawmakers for SpaceX.The lobbying report says the firm attempted to influence the Biden administration for SpaceX to “support commercial launch provisions in NASA programs, appropriations, reconciliation, and S.1260, United States Innovation and Competition Act of 2021.”SpaceX also hired Miller Strategies, which is run by Jeff Miller, a staunch ally of House Minority Leader Kevin McCarthy, R-Calif, and former President Donald Trump. SpaceX paid the firm $30,000 in the third quarter to lobby the House and Senate on “issues as they relate to space transportation and space transportation costs,” according to the latest lobbying report. Miller was one of the lobbyists trying to influence lawmakers for SpaceX last quarter.Regulatory fightsMusk’s battles with regulators are often public and messy.After the National Transportation Safety Board and National Highway Traffic Safety Administration investigated Tesla for vehicle safety defects this year, Musk accused them of bias.One recent major NHTSA probe of Tesla will determine whether the company’s Autopilot driver assistance software was partly or wholly to blame in crashes that involved Tesla cars ramming into parked, first responder vehicles on the side of the road.After that probe was underway, the White House said that it was appointing Steven Cliff to head the National Highway Traffic Safety Administration and would also hire a former Navy fighter pilot and Duke University engineering and computer science professor, Missy Cummings, as a senior advisor for safety.Musk targeted Cummings, a known Tesla critic, on Twitter, saying “objectively, her track record is extremely biased against Tesla.” Fans of Tesla and Musk began haranguing her on social media while attempting to deface her biography page on Wikipedia.Cummings had industry experience as a board member for Veoneer, an autonomous vehicle tech company. Some Tesla fans asked whether that affiliation was a potential conflict of interest. Cummings resigned from the company’s board effective Nov. 1 having accepted the NHTSA job.Meanwhile, Musk who has clashed with the NTSB for years, and Tesla have refused to adopt safety recommendations from the independent federal safety authority.Musk has also expressed his displeasure with the SEC on multiple occasions on Twitter. In 2018, Musk and the commission reached a settlement over remarks Musk made about an ultimately abandoned plan to take Tesla private.Twitter flame warsMusk has taken multiple digs at Biden. When SpaceX launched a nonprofessional flight crew into orbit in September, for instance, Musk groused that the president did not personally call to congratulate the astronauts involved in the historic mission.Musk has also taken aim at Biden by echoing a joke made by Trump. “He’s still sleeping,” Musk said at the time, almost mirroring the former president’s “Sleepy Joe” insults.Politics can be personal for Musk, too, especially when it comes to the battle over his billions.Musk has the highest estimated net worth in the world at over $300 billion, according to Forbes. He is one of about 700 people who would be effected by a new tax proposal from Democrats floated by Senate Finance Committee Chairman Ron Wyden, D-Ore. in October.The proposal is for a tax on billionaires’ investment gains annually to help finance President Joe Biden’s $1.75 trillion safety net package. The so-called billionaire’s income tax would close a loophole that has enabled the super rich to defer capital gains taxes indefinitely, a strategy known as “buy, borrow, die.”When Wyden published the billionaire’s income tax proposal, Musk vociferously objected on Twitter:In recent days, the CEO asked his 62.5 million followers to vote in an informal Twitter poll to determine whether he should sell 10% of his Tesla holdings, and face a big tax bill.In response, Wyden wrote in a tweet: “Whether or not the world’s wealthiest man pays any taxes at all shouldn’t depend on the results of a Twitter poll.”Musk hit back at Wyden with a vulgar and disparaging tweet, saying “Why does your pp [profile picture] look like u just came?”Wyden’s spokeswoman did not return a request for comment.