Implement BorrowFrom<&'a T> for T (with mutable variants)

This should be a more general version of #19131.