luks2() can override any auto-detection that revers back to the parent device of the mapped device, which would be crypto_LUKS instead of None for the inner partition.
disk.partitions were called. Causing flags such as .encrypted to be dropped. This should make for a more stable experience when working with the partitions.
partition.has_content(). The first does some sanity checks to verify if we can format the partition or not. The second temporarly mounts the parition and checks if there's content inside and returns accordingly.