Do not switch to the original buffer. Use `buffer-local-value` instead. The buffer switching is more costly, which slows down continuously updating completion UIs like Icomplete or Vertico if there are many variables. Ideally there would be a `buffer-local-boundp` predicate we could use here. In GNU Emacs 28.0.50 (build 12, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0) of 2021-05-23 built on projects Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Debian GNU/Linux 10 (buster)