Add XS implemetation of is_constant_sub()