It seems to be a bug of JET that @test_opt fails on this example. Especially JET still isn’t fully updated to account for the new effect system that will come with 1.8 – The call of Val(:ℯ) should be folded as a constant and so JET shouldn’t report any dynamic dispatch within it.
As for the performance, I couldn’t confirm measurable runtime regression on my local machine.