Costa Rica vs El Salvador for relocation

I’m a solo female traveler, and I’m planning to make a move to Central America soon. I’ve narrowed it down to Costa Rica and El Salvador, but now I’m stuck. Costa Rica seems like the safer, more tourist-friendly option, and I’ve heard it’s got a good infrastructure, which is great. But on the other hand, it’s a bit more expensive, and I don’t know if I want to deal with all the tourists (and Americans apparently) all the time. El Salvador seems like it’s on the rise, especially with expats, and I’ve seen some amazing photos of the beaches there, but I’m not sure if it’s as safe or easy to get around right now. I’m also a huge fan of surfing, and both places seem to have great spots for that, but I’m worried about getting bored or not finding a community of other travelers like me. Has anyone been to both? Which place do you think would be better for a solo female traveler looking to stay long term?