I'm really of two minds about this.
Absolutely, you need to consider affordability. I've known of a person who had a cat, for example, but struggled to afford food and litter. It wasn't the kind of scenario where this was an unexpected lack of funds.
On the other hand, a pet can sometimes be such a great companion. I used to know an elderly lady, on a very small income, with a cat, and she afforded food and litter with very careful budgeting. That cat was in many ways the center of her home life.
She would not, however, have been able to afford some of the costs that are now considered usual with a pet, particularly some of the vetting.
And then there is the question of what is basic vetting. Many vets can do so much now, I've known people to have cancer treatment for dogs, and a lady who spends several thousand a month on medication for a cat. Vets also pressure people into many expensive tests and procedures now that weren't even in the radar before.