Const correctness for output_dyn_value and unify some identical constants