Arsenic has a long history of medicinal use in Europe & Britain:-
https://pmc.ncbi.nlm.nih.gov/articles/PMC8860286/
I also know that it was/is used in Javanese jamu & Chinese traditional medicines sold in Jawa.
I do not know when it started to be used in Jawa & other places as a blade stain.
The warangan sold in Jawa is an unrefined, naturally occurring mineral that does contain arsenic.
I have been told by a very experienced collector of high quality Indo-Persian weapons that a mineral similar --- or maybe the same --- as warangan was used in India to stain blades.