What's the smartest way to find the scale of an unrestricted numeric type?
is there a more elegant way to do that 


Yes, use the scale() function which was introduced in 9.6:

SELECT my_numeric,
       scale(my_numeric)
FROM (
 VALUES
    (0.1::numeric),
    (0.12),(0.123),
    (0.1234),
    (0.12345),
    (0.123456),
    (0.000001),
    (0.100000)
) foo (my_numeric)


Online example: https://rextester.com/MVJQR23795