Huh? Where did "Gydag ef" and "Gydag o" come from?
Just different forms of fe that you will come across. fo and efe, too.
gyda -> gydag before a vowel
gyda fo (takes care to show it with the same lack of capitalisation as I answered with) was marked wrong on a Write this in Welsh question.
A missing variation, now fixed. Thank you.