There is probably a more mathematically elegant solution, but you could just offset where you are aiming based on the rotation of the gun.
Say your barrel of your gun is 20px higher than your pivot point, you would calculate your angle to point the barrel based on 20px below your mouse curser to compensate. If you're aiming completely up, you would calculate your rotation on a point 20px to the right, if you're aiming down below, it would be 20px to left, and if you're aiming backwards (and you don't flip your character) it would be 20px lower.
You could use an if statement to check if you're within one of these angle ranges and lerp between them.
I'm not a python programmer and as familiar with pygame, but you could do something like the following in javascript (assuming the 0 degrees is up, and y gets bigger the higher you are on the screen).
if (angle < 90) lerp({x: 20, y: 0}, {x: 0, y: -20}, angle/90)
else if (angle < 180) lerp({x: 0, y: -20}, {x: -20, y: 0}, (angle-90)/90)
else if (angle < 270) lerp({x: -20, y: 0}, {x: 0, y: 20}, (angle-180)/90)
else lerp({x: 0, y: 20}, {x: 20, y: 0}, (angle-270)/90)