Only in the broadest, most literal use of the word. When someone says "machine gun", they are almost certainly going to be referring to a man-portable automatic weapon rather than a tank-killing gatling gun.
That was not its' sole combat role. The P38 could also function as a long range escort, photo recon plane, and interceptor, among other things. The "II" in F35 Lightning II is there for a reason. And since you seem so intent on referring to autocannons as machine guns, I might as well point out that the P38 had five, so there's another similarity.
No, when someone says "Machine gun" and is referring to them on jets, most people know how devastating or powerful they are talking about and I am pretty sure the P38 did not have 5 GAU-12_Equalizers mounted on it. Instead, it was equipped
one standard T1 Army Ordnance .90 in (23 mm) autocannon with the exception of
two .30 in (7.62 mm) Brownings on a certain variant. Also, if you read a little deeper you could find out the there have been multiple attempts to make the P38 Lightning a better "dog-fighter" but many attempts failed since it lacked the capability of high speed maneuvering so the only thing close it had to air-to-air combat was to get in optimal ranges of up to 1000m (if you had a pilot with exceptional aim) and it targets at extremely long distances and/or above with higher altitudes.
Also, as far as
sole combat roles go, You listed all of the possible roles it had through history except direct combat of air-to-air.