If you want 40 sidewall and 235 wide but don't want to mess up your gearing, there's an easy solution: BUY 17" WHEELS!
Your stock size is 215/45R17. It's substantially less than 25". 235/40R18 is substantially more than 25". I would recommend a stock gearing or tighter. The 5-speed in your car is fairly tall. Smaller tires will help with low end pickup, reduce lag, and increase overall acceleration. It's an AWD car with fairly moderate HP, you don't need to worry about spinning tires. You also don't need to worry about cutting top speed as 5th goes on your stock gearing to well over the aerodynamic limit of your car (160+ if I recall correctly). In other words, lowering your gearing is a no brainer for any analysis beyond "the look". Now, I wouldn't drop below 24" or so, that's going to be too far out of factory spec and will cause other issues (changes in suspension geometry, etc). But certainly you want to err on the side of shorter tires than purposely getting one a full inch taller than your stock tire.
Also, on a personal standpoint, I think people who have massive diameter wheels which show off tiny little brakes underneath them rather silly. The look of the brakes actually filling the wheel diameter (hence a functional purpose for the wheel diameter in the first place) really make a car look more sporty to me. Seriously, you don't see anything weird looking at the rear of a WRX with 18" wheels on that are a full 3" from the brake caliber? The 06 WRX has nice front brakes which require special 15" wheels to clear. 16" is easier and still fills out the wheel. 17" is at least reasonable looking. 18" makes even your front brakes (which are bigger than 02-05 and 08+ wrx to be fair) look tiny.
2015 STi: Still Stock
04 STi, 04 WRX: SOLD