Fixed #24036 -- Added ignore_warnings decorator

No, this wouldn't break. But `simplefilter` is a little more effective as it doesn't imply any regex operation (compiling/matching). Now I realize that I should also do the same test below in the function decorator. I'll update this anyway.