It's often called "cat's eye" bokeh. Most often it is seen in fairly wide angle lenses with very wide apertures.
"Cat's eye" bokeh is the result of using a very wide aperture lens where the entire entrance pupil is not visible from the angle of the widest light rays in the field of view. This results in the bokeh being vignetted into an irregular shape. The closer to the edge of the field of view the light source is, the more pronounced the distortion of the bokeh shape will be. Highlights coming from light sources near the center of the FoV will be round or nearly round because the entire entrance pupil is visible on the front of the lens from their position. Stopped down the same lens will not demonstrate the effect even for the edge rays. If a lens is designed with uncorrected field curvature, spherical aberration, or astigmatism this can make the cat's eye effect even more pronounced and/or swirly.
When such a lens is stopped down, the full area of the lens' entrance pupil (the aperture as viewed through the front of the lens) can be seen from the field of view covered by the lens.
In the case of your example photos it is not only out of focus highlights that are demonstrating a "cat's eye" effect. It is also lens flare due to reflections inside your lens. The same principle is at work, though. The reflections aren't all circular because they're being shaped by the edges of the things they are passing through and the shapes of the edges of the things off which they are reflecting .