I heard the Messenger of Allah ﷺ say: If I drink an antidote, or tie an amulet, or compose poetry, I am the type who does not care what he does. Abu Dawud said: THis was peculiar to the Prophet ﷺ, but some people have allowed to use it, i.e. antidote.
سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ مَا أُبَالِي مَا أَتَيْتُ إِنْ أَنَا شَرِبْتُ تِرْيَاقًا أَوْ تَعَلَّقْتُ تَمِيمَةً أَوْ قُلْتُ الشِّعْرَ مِنْ قِبَلِ نَفْسِي