First of all, these hadiths the question talk about needs good understand, and don't just mean what they appear to mean.
According to this page from Zad Al-Mi'ad زاد المعاد by Imam ابن قيم الجوزية Ibn Qayyem Al-Jawziah (may Allah be merciful to him):
كما قيل في قوله صلى الله عليه وسلم : ( من شرب الخمر لم تقبل له صلاة أربعين يوما ) : إن أثر الخمر يبقى في جوف العبد وعروقه وأعضائه أربعين يوما ، والله أعلم .
And it was said in explaining the Hadith by the Prophet صلى الله عليه وسلم: "Whoever dirnks wine, his prayer will not be accepted for 40 days". The effect of wine remains in the body, veins and organs of the person for 40 days, and Allah knows best.
Zad Al-Mi'ad زاد المعاد
As it's obvious Imam In Qayyem narrated that, but he didn't mention its source. However, Imam Sindi said in his explanation of Sunan Ibn-Majah حاشية السندي على ابن ماجه that Imam Ibn Qayyem narrated that from the Explanation of Imam Soyuti for Sunan Al-Tirmithi حاشية السيوطي عل سنن الترمذي, as comes here:
قوله : ( أربعين صباحا ) قال السيوطي في حاشية الترمذي : ذكر في حكمة ذلك أنها تبقى في عروقه وأعضائه أربعين يوما نقله ابن القيم
حاشية السندي على ابن ماجه
In explaining "Forty days": Soyuti said in his explanation of Sunan Al-Tirmithi: "The reason of that is because the effect of wine remains in person's veins and organs for 40 days". And Ibn narrated that.
The explanaiton of Sunan Ibn-Majah by Al-Sindi
However, I don't know if this is proven scientifically, (nor that's important for me to accept that Hadith, although I would like to know if it's scientifically proven out of curiosity).