"Mae ei farn yn dwp" - "His opinion is stupid". If you changed this to "Mae ei barn yn dwp" would it mean "Her opinion is stupid"? I'm still trying to grasp how the mutation works around pronouns.
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'