Q:

As of August 2017, what would it take for Bernie Sanders to assume the presidency of the United States?

Yes, I am aware that November 2016 has long passed, but what would have to happen for Bernie to assume the presidency while Donald Trump is still president? I'm aware of a line of succession (president, vice president, Cabinet members), but what's the line of succession after that (for Bernie to win?)?

A:

This is absurd.  It will never happen.  That said, Bernie Sanders would have to do one of 

Get appointed Vice President.  This requires the VP slot to be vacated (by death, impeachment, resignation, etc.) and for someone to pick Bernie for it.  Then the President has to leave.  
Get appointed to the cabinet.  Then everyone ahead of him has to vacate.  
Get chosen as President pro tempore of the Senate.  This typically goes to the longest tenured Senator of the majority party.  It seems unlikely that Bernie would be accepted as a Republican, so the Democrats would have to take back the Senate.  
This is possible but unlikely in 2018, as so few Republicans are up for election and only one in a Democratic state.  The Democrats need three.  They might be better off hoping for resignations or deaths.  
After all that, Bernie still needs the President, Vice President, and Speaker of the House to vacate without being replaced.  Also requires that the Democrats choose him and not someone who was actually elected as a Democrat.  Technically, Bernie is still an independent.  
Leave the Senate and go back to the House of Representatives by either election or appointment.  Be elected as Speaker of the House (similar problems as the Senate, although the House Democrats have a better chance at a majority after the 2018 elections).  Requires the President and Vice President to vacate the office without replacement.  

All of these choices are ridiculous.  They each require multiple, weird things to happen.  The most likely scenario might be a nuclear bomb in Washington, D.C. where Bernie happens to be out of town where everyone in the regular line of succession is there.  Even that still requires him to be chosen as the President pro tempore of the Senate prior to a Speaker of the House being chosen.  Or prior to the nuclear bomb--it's at least possible for 2019.  
Bernie is not in the current line of succession.  There's no succession after the cabinet.  So he first has to get into it.  Then everyone ahead of him needs to get out of the way at the same time.  Neither of those things is at all likely.  He's not really in line to join the line of succession.  And we've never had more than one succession (by the Vice President) in a presidency.  None of the later slots has ever reached the presidency by succession.  
It is far more likely that he's elected president in 2020.  

