Split TCast::to into TCast::to_unchecked and TCast::to

fix #1836