In my opinion the reason of the observable difference in performance may be the fact that methods/functions containting try/catch block will not be inlined, at least for sure not by MSVC compiler (see https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4714?view=msvc-170 )
Before the change void foo(int a) couldn't be inlined. After the change it may have been inlined.