Lucky for us, with .NET Core, Microsoft have added extension points everywhere. On such extension point is in StaticFileOptions.
Evil Monkeypatching in C# with Rosyln Source Generators
I came across this as I was trying to find a way to add a shim onto a sealed class from the Microsoft BCL. The goal was to provide a package that allowed people using that class to get a wrapper very easy without having to change their code.