Pathing is pretty simple to think about. Imagine that you're sitting at level 0. Every tile around you is 1 inch higher. 2 tiles away is 2 inches higher. This continues outwards, such that you're sitting inside a shallow pit.
When you decide where you're wanting to go, then that location becomes 0 level. Now every tile around your destination is 1 inch higher, and so on. When this happens, you end up with two shallow pits, and it's pretty easy to see the quickest way between the two.
Pathing cost is an arbitrary modifier. If you set pathing to Restricted, then you select one tile and raise it by a foot. Now it becomes awkward to pass through that tile, so you go around. If you set a line of restricted traffic, then it's easier to go around that line. However, if the only way to get from A to B is to go over a line of restricted traffic, then that's the ONLY way to go, and you'll climb those steep hills because there is no other way.
So if you want to totally remove travel, then set burrows. If you want to totally remove traffic through one route BUT ALSO let them go another route, then you have to make them another route and not set it as restricted.
ALSO! Pathing is a flood operation. Every tiles away is 1 cost more than the last. So if you set your restricted rating at 99, and the only way to get somewhere is to go through a restricted section, then your dwarves are going to end up trying pathfinding through EVERY OTHER tile on the map, which can cause moments of intense CPU lag, and cause one frame to hang briefly. If an entire garbage dump is set as restricted, then moments of garbage collection are going to cause stuttering. Instead, you should set your hallways as high priority and edges as restricted, with very few areas actually sealed off from traffic. You actually end up doing better if you only use High and do not use Restricted, as this achieves roughly the same result and improves your FPS.