I'm not sure but I think that both phrases are incorrect, because the verb "to shave" is a Transitive verb. That means that the person who carries out the action can't be the same as the object affected by the action.
I would say: "the man shaves off his beard" ( the man = person who carries out the action; "his beard" =the object affected by the action)
It'll be great if native English speakers post their opinion here.
Hope it helps.