Yes, you are correct. There is a soft mutation after 'his' (ei) (which affects nine of the following consonants) and an aspirate mutation after 'her' (ei) (which affects only three of the following consonants (T.C.P))
This is the most obvious way of differentiating between 'his' and 'hers' in this sort of sentence.
Although to make it totally unambiguous it's possible to add the other bit of the possessive pronoun.
'Mae ei farn e yn dwp' = 'His opinion is stupid'
'Mae ei barn hi yn dwp' = Her opinion is stupid'