Similar to `lib.mkRemovedOptionModule` but tweaked to work with sub-options (e.g. settings options). Also uses warnings instead of assertions.