Yes, Junger v. Daley held that source code is speech for the purpose of First Amendment analysis in the Sixth Circuit. (The question has not yet been presented to the Supreme Court.)
But the inquiry doesn't stop there. First Amendment jurisprudence doesn't stop at asking the question "is this speech?". That's just a threshold question. If the answer is "no," then the case is analyzed one way. If the answer is "yes," then the case analyzed a different way. Think of it like a decision step in a flowchart.
Code being treated as speech doesn't automatically mean that software developers can do whatever they want, just like it doesn't mean that people who write, draw, make music, etc. can do whatever they want. It's not the magic unassailable defense you claim it to be. Courts will apply a balancing test to determine whether the Government's interest in prohibiting the speech outweighs the Constitutional interest in protecting it. The answer comes out different ways depending on the facts and the law, which is complicated.
For example, it's unlawful to make and distribute CSAM. It's unlawful to defame someone. It's unlawful to defraud someone. It's unlawful to violate others' copyrights. You have to label food and medicine a certain way. These are all forms of speech, but the courts have held that none of these restrictions (or requirements) violate the First Amendment. And I don't think we'd all be cheering someone on and claiming "code is speech" for someone who writes ransomware or software whose sole purpose is to drain your bank accounts or shut down power plants.
I didn't claim it's a magic unassailable defense. I claimed, contrary to the previous comment, that it's a valid defense. Maybe the courts will carve out a new exception for some particular type of code, maybe they won't, but what they certainly won't do is laugh at you for defending your code on free speech grounds. Just because a legislature passes a law doesn't mean the courts will agree that the law is valid under the Constitution.
And the bar for compelling any particular speech is generally quite high. Apple could not be compelled to put a backdoor in an iPhone, even though the suspect was the San Bernardino shooter, and this did not result in Apple losing their ability to sell iPhones. The courts may well hold that you can't compel a Linux distro to implement a particular feature either.