Regarding declaring something forbidden upon oneself, it constitutes an oath. Ibn Abbas used to recite, "Indeed, in the Messenger of Allah you have an excellent example" [Ahzab 33:21].
حدثنا محمد بن يحيى حدثنا وهب بن جرير حدثنا هشام الدستوائي عن يحيى بن أبي كثير عن يعلى بن حكيم عن سعيد بن جبير قال
في الحرام يمين وكان ابن عباس يقول {لقد كان لكم في رسول الله أسوة حسنة}
Bukhari, Tafsir, Surah Tahrim, chapter "O Prophet, why do you forbid what Allah has made lawful for you," no. 4911, and Muslim, Divorce, chapter on the obligation of expiation for one who forbids his wife to himself without intending divorce, no. 1473, from the hadith of Hisham Dastawai, through this chain.