I think most of the hostels limit stays to 30 days or less because of housing laws in San Francisco. I suppose maybe you could move from one hostel to another if you thought it was a better solution. It looks to me like the hosteling international places are now charging around $50-60 a night for a bed in a shared room. That's about $1500 to $1800 a month to share a room. Some hostels supply a cheap pancake breakfast if you pour and cook the batter yourself (or similar), but don't usually supply other meals to my knowledge.
Looking up other student accommodation is a good idea and unfortunately i don't think most posters here will be very aware of the options.
I'd also be careful of renting some of the hotels that only rent to a single person in a tiny room usually without a bathroom attached to the room. These are known as "single resident occupancy" (SROs) and often rent to very low income people and often have a higher percentage of people staying that have problems such as heavy drug and alcohol abuse or other issues. It would likely not be a great place to stay with more frequent noise disturbances and perhaps more safety issues. I'd suspect student housing of most kinds would be better than what you would experience at a SRO hotel.