Upon second thought, I do think there's a way to make the idiom work with a std::bit_cast that only clears input padding:
using Tmp = std::array<unsigned char, sizeof(T)>;
Tmp tmp = std::bit_cast<Tmp>(src); // or std::bit_cast_clear_padding
std::memcpy(src, &tmp, sizeof(T));
Since byte arrays have no padding bits, there is no issue with padding bits in the std::bit_cast result. It's crucial to then memcpy back into src rather than using the assignment operator; in that case, I think this can clear padding in the source.