In WW2 aircraft, where were gun cameras mounted, and did they suffer performance penalties?
It was a small 16mm film camera usually mounted, in single engine fighters, in the inboard area of the wing, within the leading edge behind a little window (the P-38's is also about the same location between the center pod and left engine) or in the nose in twins.  

Look carefully at a lot of gun camera film on something like a P-51 when the sun is lighting up the prop from behind and you can see that the camera is viewing through the lower left quadrant of the propeller arc, being just a couple feet to the right of the left side wing guns.  Most fighters only had up to 30 seconds of continuous firing time in ammunition, so it didn't need to have a really large film supply.  

On some systems the camera could be set to run only during firing or could be run independently and there was a little flag that appeared in the upper left corner of the film image and lifted out of the way when the guns were firing and dropped into view then they weren't.  

A lot of pilots started to do away with tracer ammunition when lead computing gyro gunsights started to appear in 1944, so often the little flag is the only way you can tell the pilot is firing other than bullet strikes (and vibration from the guns sometimes) when you watch gun cam movies where no tracer is being used.

The weight penalty was negligible, only weighing a few pounds, and the drag penalty was also negligible, being buried in the leading edge behind a clear panel, like a small landing light.