I think Buchanan has gotten a bad rap. I don't think he was as bad a president as most historians claim he was. He has been condemned mostly because he (correctly) argued that under the Constitution the federal government did not have the right to use force against states that voted to leave the Union, and that the Union was not intended to be held together by coercion. He has also been condemned because he (correctly) placed much of the blame for secession on the Radical Republicans and the abolitionists.
I think Buchanan's biggest mistake, in terms of precipitating the Civil War, was not evacuating the federal garrisons in the seceded states, especially the garrison on Fort Sumter.
I am not convinced that war was unavoidable. The majority of Americans favored a peaceful compromise on the issue of slavery in the territories. As far as we can tell, a sizable majority of Americans favored the Crittenden Compromise, which would have, among other things, essentially moved the Canadian border to the northern border of the Southern states, would have set up a de facto system of compensated emancipation, and would have prevented the expansion of slavery north of the Missouri Compromise line.
To be clear, Southern Fire-Eaters shared much of the blame for the secession crisis and the Civil War, and the seven Southern states that seceded first had no valid grounds for refusing to honor the 1860 presidential election results.