This is very related to the concept of “Opportunistic dependencies” in general. See this topic suggestion for the packaging mini-summit, which links to this packaging-problems
issue.
As I mentioned in that thread, I think this a more general problem, where there are other possible “nice to have” style dependencies that you want to be either opt-out and/or “soft failing” other than extension modules.