Might as well develop an external gunpod for it.
That is certainly one option, but not one without some penalties. It really depends on what they determine to be the frequency of use. The B and C variants of the F-35 use the gun pod solution because they have fewer mission profiles that would make having a gun prudent, especially in joint missions with the air force (and because the A variant has some extra space where the lift fan would have been installed).
Designing space for a gun inside the fuselage and not using it doesn't sound as wasteful as it might seem. Space penalties would be minimal if they can make that space interchangeable with a fuel tank. I can't speak to how practical this would be of course, since I'm not a fighter plane engineer, but good designs assess their options.