CLN: Use correct exception types in config.py machinery
CLN: simplify code in config.py
ENH: expose option_context as a top-level API GH5618
Merge pull request #5752 from y-p/PR_expose_option_context

Make set_option into context manager