There are quite a few motels on Lombard Street that will not ask too many questions. When I first visited San Francisco, I was definitely under 21 and they did not care. I think the one we stayed at was called San Francisco Motor Inn or something like that. There are a few others if this one does not exist any more. They are cheaper than downtown locations as well, but of course they are not luxury places.
Lombard St is a safe location, a few blocks away from Chestnut St, which is a quite popular place for the young crowd with a lot of restaurants, bars coffee shops and an Apple Store
. If you check the address of Apple Store, you'll see the popular part of Chestnut Store. (Chestnut street is quite long and the rest of it is residential.) Lombard is also close to other attractions such as Marina, Palace of Fine Arts (this is actually a nice park, not a museum), Fisherman's Wharf and North Beach ("Little Italy" of SF.) Golden Gate bridge is not that far, either.
It is not that close to downtown, but I remember taking the bus to downtown and cabs cannot cost too much either if you are pressed for time.
Have fun...