Starting with C# 8.0 I can do this:
interface IMyInterface { #nullable enable void DoSomething(string? withValue); #nullable disable }
i.