Same as you might say "I'm an engineer" to a non-technical person vs. "I'm a Go backend engineer" on a tech meetup.
If a particle physicist is opining on particle physics to the general public, they'll self describe "as a particle physicist" or at the very least "as a physicist". They'll use the most precise term that is likely to be understood by the audience. Only if that person isn't a physicist at all will 'scientist' be the most precise expertise they can claim. The general public is comfortable with the word physicist, so there's no reason for a physicist to avoid identifying as such when discussing physics with the general public.
On the other hand, a marine biologist who is opining on particle physics may self describe "as a scientist", because that's the most precise level of expertise they can claim without lying. Saying "as a biologist" when discussing particle physics wouldn't confer the desired credibility, so a less precise term is used.
Conspicuous lack of precision is the tell:
If people are discussing basketball and somebody says "as an athlete", it's safe to conclude they aren't a basketball player. They would have said "as a basketball player" if they were.
If people are discussing motherhood and somebody says "as a parent", it's fairly safe to conclude they aren't a mother. If they were a mother, they'd say "as a mother" because that more precisely relates to the topic of motherhood.
If somebody is opining on firefighting practices and says "as an emergency responder", they aren't a firefighter. They might be an EMT or a cop, but a firefighter would say "as a firefighter" when discussing firefighting.
And finally, if a Go backend engineer claims his expertise to be "programmer" to a general audience, that's fine. But if he's saying "as an engineer" or "as a scientist" then he should probably be ignored. Yes, I've known people to do this, programmers calling themselves "scientist" because they have a CS degree, opining on bullshit unrelated to anything they ever studied.