Maybe I misunderstood, but I thought what was being discussed here is preventing the planner from selecting an index for use in queries, while still requiring all table updates to maintain validity of the index.
The O-ther big DBMS has `ALTER INDEX ... INVISIBLE` feature, that does exactly this.
I was thinking of a function, similar to `set_config()`, for it has `is_local` parameter, making it possible to adjust just current session or a global behavior.