He (Ibn Hazm Al-Andalusi) says,
الآية السادسة قوله تعالى "إنما التوبة على الله للذين يعملون السوء بجهالة ثم يتوبون من قريب" الآية 17 مدنية النساء 4. وذلك أن الله تعالى ضمن لأهل التوحيد أن يقبل أن يغرغروا وقال رسول الله صلى الله عليه وسلم كل من كان قبل الموت
Brief translation:
God guaranteed for the people of monotheism to accept [their repentance] before they gargle, last moment before death, explained the Prophet (PBUH).
The same words were used by Ibn Abbaas to claim that
was abrogated by
This claim has some merit, while the related claim of
4:18/4:17 had none. The question is "If a disbeliever declares his faith at the moment of death, will God forgive him?"
We have evidence from 4:48 that God
may forgive him. The key phrase is "whomever He wills". His will has been not to accept Pharaoh's declaration of faith as he was drowning. His will has been to accept the repentance of sinners who sin out of ignorance (4:17). And His will has been to reject the repentance of those who claim it at the moment of death, or who die as disbelievers (4:18). Lastly, His will is that He will not forgive polytheism but may forgive any thing less (4:48). It's all consistent and there isn't anything in 4:17, 4:18, 4:48 or the hadeeth that is contradictory requiring a claim of abrogation.