use Codegen.default_cast for safe casts
fix typed cast elif
do not discard is_value when recursing into transform_expr