For 64 bits the C short version is already optimized.
True it is good, as well as clear, also easy to change for example to int16 checking. But it could be better 'on average' over the set of all possible int32 10 digit inputs. Knowing that only 10 digit inputs need detailed checking ( >10 is overflow, <10 is no overflow) then we also can know that 8/9ths of all 10 digit inputs
don't require the full number to be created to determine if an overflow will happen. Only the first digit needs to be checked for a possible quick return. The while loop only needs to run if the first digit is a 4, if it is 5-9 overflow occurs, if 1-3 no overflow. So adding two if's nested before the while loop will speed up the check for 8/9ths of all possible inputs and slow it slightly for 1/9. The 5-9 if first returning overflow, else 1-3 if returning no overflow, else run the While loop to check.
If there was knowledge that most cases would not overflow I'd reverse the 1-3 check and 5-9 check.
I'm probably overthinking it - but hey shelter in place so kind of ,fun