I don't know what to say about Type XXIs being introduced earlier in the war, but several of them served in the French and Soviet Navies post-war (and of course, Germany raised one for post-war useand eventually as a museum). The French ones served until the 1960s, and the Soviet ones served until the late 1950s (although one was retained as a training vessel until 1973). All of those were eventually scrapped.

Also, the British and US appeared to be only interested in gaining information from the XXI design, and then using them as targets.

But I guess post war designs built from the knowledge gained through these subs rendered them obsolete in the post war years anyway.
BTW - I don't think any Type XXIIIs saw any extensive service with Allied post-war navies - the USSR and Norway each commissioned one into their respective navies, but sthe Norwegian one was scrapped soon after. I think some VIIs and IXs saw service with the French, Soviet, Norwegian, and Spanish navies until the 1950s-1970s (I think they were all VIIC, VIIC/41, IXC, and maybe IXC/40).