I have what's I like to call "resting jerk face". I've heard women call it "resting bitch face". I've had your exact situation before.
What I do is explain to them "resting jerk face" is just my natural relaxed face and then I assure them that I'm happy and that I can't really change how I look. I then say that I don't want to fake a smile because I don't fake well. I also say that what looks irritated to other people is just me thinking really hard.
The reality is that they will get used to it. Just be consistent and say that you can't help it help it and reassure them that you're a happy person.
In my personal experience, you're not likely going to lose your job because your boss thinks you don't smile enough as a programmer, though as some commenters have stated, that's not always certain:
Word of caution on that last point, when my last company had to lay off people throughout multiple departments, the manager of my team picked the 2 people who seemed the most negative. One really was a downer, the other though was more like you describe. Unfortunately he was a pretty closed person, so the manager only saw the "resting jerk face", and we lost the most experienced guy on a particular product rebuild.
and
I was almost put on a PIP because I didn't like to high five and chest bump co-workers (although never left them "hanging") the manager at a time told me that "perception is reality". Obviously I shortly left that company and found a much better one.