There is no paradox, only an ambiguity.
If I were given the task of writing a program to simulate this, I'd request a specification clarification because, as stated, we can't tell whether he shaves any of his customers, due to time ambiguities in the definitions of "shaves someone" and "shaves themself" preventing them from being evaluated as true or false.
If someone has ever shaved themselves, are they forever in the self-shaving category, for a single shaving incident?
Contrariwise, if they are not at the current moment holding a razor to their throat, are they considered to be in the non-self-shaving category?
If it's time-bounded as "shaved themselves today", then does the barber shave everyone instantaneously at midnight?
So, clearly, the specifications of the problem need to identify:
- Over what period do you test whether someone has shaved themselves?
- Over what period does he shave them?
And as soon as you put in a time constraint onto these definitions, then the supposed paradox entirely disappears.
If "shaves a citizen" is defined as something like:
- "shaves a citizen on entry to his store"
- "shaves a citizen on request"
- "shaves a citizen by the end of each day"
- "shaves a citizen on Tuesday"
- "shaves a citizen at one or more undefined points in his life"
- "shaves a citizen when he sees them"
...and if "shaves themself" is defined as something like:
- "shaved themselves yesterday"
- "shaved themselves so far today"
- "shaved themselves ever in the past"
- "shaved themselves this year"
- "shaved themselves within some undefined period"
- "identifies as a self-shaver"
...then we end up with rules like:
"The barber shaves shaves each citizen on entry to his store, if they have
not shaved themselves yesterday." --> the barber shaves himself only on
alternate days.
"The barber shaves shaves each citizen on request, if they have not shaved
themselves so far today." --> the barber shaves himself whenever he
likes, but no more than once a day.
"The barber shaves each citizen by the end of each day, if they have never
shaved themselves in the past." --> the barber shaves himself only once
in his lifetime.
"The barber will shave each citizen every Tuesday, if they haven't shaved themselves yet this year" --> the barber will shave himself on the first Tuesday of each year.
"The barber will shave each citizen at one or more points in his life, if they haven't shaved themselves in some set time range from those points" --> the barber will shave himself at least once in his life, at the first point he can.
"The barber will shave each citizen when he sees them, if they don't identify as a self-shaver" --> the barber will shave himself any time he sees himself and doesn't at that time identify as a self-shaver: if he identifies as self-shaving before actually ever shaving himself, then he'll potentially never shave himself unless he changes his identification.
Whatever time rules you apply to the self-shaving test, and to the shaving action, the problem goes away, because you can then clearly define not just whether but also when the barber shaves himself.
In short: this is not a paradox, even in any natural language; it's just a case of incomplete requirement specifications, which prevent the initial statements from being evaluated as true or false, not just for the barber, but for any of his customers.
Note that it remained a non-paradox, with a clear outcome, even in case 5, where we didn't provide precise specifications. The result was simply true: in every case the barber does shave himself, at least once. So, that's the overall answer to this paradox.
It also remained non-paradoxical in case 6, but with a specification-dependent outcome, as we left undefined what caused the self-shaver
flag to become set, but as soon as that's well-defined, the outcome becomes well-defined too.
We could try to make a paradox by having the self-shaving state be continuously tested, rather than being tested only once at the start of shaving. Even then, the answer is non-paradoxical and well-defined once we define whether the state is changed a the start or end of shaving: either "the barber touches the razor to his skin once, then stops," or "the barber shaves himself fully once, then stops."
It gets a bit more paradoxical if shaving is both instantaneous and simultaneous with the state change. Even then, I'd argue that in that case he switches from (shaved=0, self-shaver=0) to (shaved=1, self-shaver=1), so again there's no ambiguity: yes, he shaved himself.
So long as we can evaluate whether any arbitrary customer has the self-shaving state, and know when the barber will evaluate that state and shave them, I can't find any way to make this paradoxical even in natural language.