I'm going to detail what I'm currently doing. Please note, this is very tinfoil hat-like, but its working for me. I used to get banned a lot. Now I don't.
I've been banned on several other accounts in pretty quick succession (usually within a day and a half). On further reflection, I was doing some pretty insane botlike behaviour. I had been going at speeds that no human could realistically keep up for the length of time that I botted each day. I also botted at some strange hours for my timezone (middle of the night/excessively) and did some other strange things.
This current account I'm using hasn't been banned in over a week and a half as I've been very conservative with how I bot with it.
I should also note I also have an account that clearly botted early on that I stopped botting on before the banwaves (I started a new account to play on the same team as my GF) which hasn't been hit, but had 95+% accuracy on Pokeadvisor before Pokeadvisor was locked out and was detected as a cheater on that site, so I don't feel they're retroactively investigating accounts. We have a static IP address as well, so they could easily cross reference old banned accounts with newer ones.
I'll detail all the settings I use below:
Using a verified PTC account.
I bot somewhere between 4-8 hours per day. I've not done any teleporting around and if I've changed cities (which I have once), I made sure to leave a large margin of error. EG, it was about 15 hours going a distance that is about 6 hours by driving. Since I work from home, I usually run the bot in a couple of "chunks" of time, eg couple hours a piece to represent putting some time in. If I'm botting in the evenings, I will actually speed the bot up to cycling speed, in an attempt to represent "exercising" periods.
Now as for actual settings
General
Run Between Pokestops
Speed - Walking
Stop Randomly on Pokestops - Yes
Logic, Catch Pokemon, Loot Pokestops, Transfer Pokemon to Professor, Stay near a Lured Pokestop
Catching
Use CP Based strategy
Pokeball - 1
Greatball - 320
Ultraball - 615
Never Use Masterball
Use Random Throw Accuracy
Transferring
Transfer all, but keep 2 of highest IV
Inventory
Recycle Pokeball and keep 100
Recycle Greatball and keep 100
Recycle Potions, Revives, Berries to 0
Please note. I do NOT have any of the transfer immediately settings enabled as I feel that is classic bot-like behaviour even though it is on by default. Turn it off if you create a new account.
I've also started the bot near where my phone actually was when I first created the account and botted locally. I then stopped the bot when I hit level 10, waited about 20 minutes so that I could realistically "walk" back to where I actually lived, switched back to my phone and tapped on a local Gym to select my team. I then continued to bot from my location so that it appears that I hit level 10, chose teams, and continued to play legit (if my account is investigated).
I have never had GPS off on my phone with this account (I have had with other accounts). I've also never logged into Pokefarmer and my phone at the same time. I've been super paranoid and even quit the app on my phone before I start up the bot.
I hope these setting helps others out. The main thing I've learned so far, is don't play stupid. This current account is only level 27, but I'm playing on it conservatively and I'm avoiding detection so far.
EDIT
I should also perhaps note that there are a couple of other things I'm currently doing that may or may not be contributing to avoiding detection so far.
I've read a lot about soft bans and like I said above, I'm not teleporting around and leaving ample travel time if I move areas. I've not noticed any soft bans when I've restarted the bot in a new area.
Similarly, I'm also ensuring that I don't start the bot up at the same co-ordinates it was when I shut it down if I leave it for more than about 5 minutes. Especially if I start the bot again the next day. This feels like a clear indicator of bot-like behaviour, if you broadcast to Niantic that you were at the exact same spot that you were 10 hours ago, played for 8+ hours straight, log off, then start back up at the exact same co-ordinates you logged off at the next day. People don't do that. We either start up at the same spot(s) consistently (work/home etc) and start from there, or we start from a seemingly "random" location. I always ensure I move the bot before I start a farming session, even if its only a street or two away.