Fun fact the russian did something like that way back.
The Soviets built a station code-named "Almaz," a space station that held spy equipment, radar, and the R-23M, a 37-pound 14.5mm automatic cannon that could fire up to 5,000 rounds per minute that was accurate up to a mile away. There was just one problem: aiming the cannon. The cosmonauts in the station would have to rotate the entire space station to point the weapon.
View attachment 46070
https://www.wearethemighty.com/history/soviet-space-cannon-in-orbit