difficult to give a definitive answer. Certainly 40K (say 30K after fitting the septic tank) would buy you a fairly good off grid system.
If you want a fully automatic fit & forget system which will supply all the power a typical household uses when on grid, then forget it - they don't truly exist.
but if you're reasonably frugal, are willing to use power preferentialy when it's coming in, perhaps include a backup genny (most off grid folks I know of have a genny even if it only runs once or twice a year), and are willing to learn about battery/genny/system maintenance then, yes, you could do it for less than 30K.
If you do go off grid it's best to have a mix or sources if you can manage it solar & wind, say, or solar and hydro(though there's a lot of red tape for hydro).
But with solar panels being relatively cheap, maintenance free, and easy to install you could do very well with just solar, a big battery, and an off grid inverter, like Sunny Island, which (I think) includes a charge controller with auto generator start. As long as you maintain the battery, the genny and make sure the fuel doesn't run out you can live like a 'normal' person. Say, 6K for solar panels (12KWp), 4-6K for a good battery, 2K for a generator and 3-4K for a good inverter and another K for bit's'n'bobs, I'd guess 18K would cover it (NB. I've plucked these figures out of the air a bit so don't quote me).
As Henchard said the problem with solar is you get the leaset when you need it the most.
I generate most of my own power even though I still have grid power, though I do it mostly 'cos I want to. I have just 900W of solar and during the recent heatwave I was running lights, radio, laptop(TV), two chest freezers (one small 24/7; the other big, but just making Ice during the day), and still dumping enough surplus into the immersion heater to have daily hot baths for a month straight (tank up to 75°C on occasions). I could have run the washing machine too but my inverter can't handle it. I run kettles/ arc welders, etc of the grid for the same reason.
During last mid-winter month I had enough power for lights, radio, laptop(TV), and the small chest freezer 24/7 for about 4 days in 5 on average (had to switch the freezer to grid power when it was really dull for extended periods).