I've run into this in code that completes synchronously in the common case, but falls back to an async implementation - think caching. The simple way to write this creates a state machine even on the synchronous path.
It's possible to work around this efficiently by pulling the async code into a separate method and using ValueTask for the outer method return type.
It's possible to work around this efficiently by pulling the async code into a separate method and using ValueTask for the outer method return type.