Wasn’t the F4 similarly equipped off the assembly line, only to have a gun added later?
Yes. guns were considered old school an they had only missiles so when they were expended, those planes were just more targets for the MiGs. I believe a number were lost that way and so the retro fit.
They added a gun pod. Externally.
Yes. It was the replacement for the Crusader, known as the last gunfighter. When deployed in Vietnam it quickly was outmatched by the MiG 21 because of dogfighting required guns.
Yes. They added mini-guns in under-wing hard-point pods: not very conducive to aerodynamic or ceegee optimization.
However, others here make a valid point about the J-20’s specific intended mission.
The Phantom II was a large, heavy, multi-purpose fighter-bomber that was at a disadvantage with smaller, lighter, tight-envelope MiGs in close-quarters dogfighting combat.
P.S.
I love the F-4 design, but it was interwar foolishness to think that missiles made guns passe.