In Alastair Reynolds' "House of Suns", the Gentian Line of spacefarers construct "stardams" around stars to prevent their supernova outbursts from harming nearby civilizations.
Given the amount of empty space out there, the amount of black between stars, it would seem more efficient to create shields around the civilizations than around the stars themselves.
"Efficient" in the economical sense, that is. Unless, the civilization covers a very wide area (basically everywhere in there, for light years around the impending supernova) and the protection amounted for each and every civilization zone would surpass the containment circle/cylinder/sphere around the star. In such case the sensible solution becomes to just recognize the area that can not be saved (no mater what) due to its proximity to the star and the limits of walling withstanding capacity, evacuate that, and set the containment all around the future explosion as close as possible instead.
This kind of "things we think are natural are actually the product of intelligences much larger than we currently can imagine" is all throughout John C. Wright's "Count to the Eschaton" sequence as well.
I probably read it three or four decades ago, along with others by those two authors and Heinlein as well. Easily confused, as I now live with a dog named Asimov!