Its not true that only dwarfs can be kept in community settings. Certain members of the geophagus family don't see smaller fish as food as they only take food from the sand. You can have a 8 inch one with small tetras no problem. They are also quite gentle and will not attack unless provoked. Other fish such as the blue acara and severum will leave any fish that it cant fit in its mouth alone as well.
Go for the 40 gallon since bigger is always better as long as you have the space. If you want a nice cichlid try looking at red head geophagus tapojos, blue acaras, rotkeil severum, firemouths you could probably keep one as your centrepeice. Along with that you can keep a pair of rams as well. If you want to go smaller you can try angelfish or festivum or laetacaras in a group of 4-5. This will still leave you enough room for a school of dither fish, and some bottom dwellers
Just one more idea, if you want a really fun and interesting tank try going species only and getting either 6 convicts or 8 kribensis. Scape with good rockwork, driftwood and plants so they can really establish teritorries. These cichlids breed readily and you'll have hours of enjoyment watching them breed, defend the young and socialize with each other. Species only though because these fish can get really nasty during breeding time and can kill other types of fish not equipped to spar with them.