Good point, it does seem like it perhaps could be added to the basis. If so, then the S corporation should do that at the corporate level. That's a tricky question.
In any case, I was mainly thinking of that with an S corporation, you have to generally follow the same kinds of rules as for individuals, sort of, with regard to this stuff. That's the purpose of having separately stated items. You can't just deduct something on page 1 of the 1120S because it's a necessary expense, you have to separate out items with special tax treatment, whether it's charitable donations, investment interest expense, Sec. 1231 losses, or (as I was thinking in this case) other investment expenses which are subject to the 2%-of-AGI limit (and non-deductible in 2018-2025).