How to define uniformly larger accents in math?

Thanks for the link. It pointed me to a solution that kind of works:

#let Tilde(it) = $limits(it)^tilde$
$ Tilde(U) quad x^Tilde(U) quad x^x^Tilde(U) $
$ Tilde(I) quad x^Tilde(I) quad x^x^Tilde(I) $

image

What’s nice is that I can adjust the tilde size, e.g. by replacing tilde with text(1.4em, sym.tilde). But the spacing is not quite right, and adjusting it with baseline doesn’t work for all sizes (see example below).

The main problem with this solution is that sym.tilde is the wrong symbol: it’s meant as operator and doesn’t look good as accent. When I try to force usage of the accent, I have to adjust the baseline and it doesn’t work for all sizes:

#let largetilde = text(
  2em,
  "\u{02dc}",
  baseline: 0.35em,
)
#let Tilde(it) = $limits(it)^largetilde$
$Tilde(U) quad x^Tilde(U) quad x^x^Tilde(U) $

image