What makes them get like that, and how can one discourage it? I'm afraid that (a) I'll step on him and really hurt him or that (b) I'll trip over him and really hurt myself.
They get that way because they're small and they like you. When I'm carrying something (and don't want to trip and can't see where he is), I make sure to walk with my feet close to the ground and my legs close together. Kind of unnatural, but otherwise he's between my legs and under my feet.
It seems that many kittens do this, and if you accidentally kick him with your foot he will probably not be hurt by it, nor will he start to hate you. When I get dressed in the morning, my kitten runs around as if he were on fire, and often will go face first into my leg or shin. This morning he rammed into me so hard it actually hurt a bit! He just bounced off, shook it off, and continued the mad dash around the room. He figures I'm a moving obstacle, I guess.
Just remember that it's far better to accidentally toe or nudge your cat, who weighs very little, than step on them or trip and fall on top of them (since most owners weigh between 5-20x their cat's weight). The speed at which your legs move when walking aren't really enough to hurt a cat that's on its feet.
The worst part is when I go to put my foot down, and the cat moves under it! I've learned to just keep my foot going down, slowly, and the cat will move out from under it by themselves. You can't both react at the same time... because so will they!
Mine does that too, but not as much as he used to, at times he'll even sneak up on me and jump at my feet and if I'm paying no attention, I do trip... just walk carefully without lifting your feet too high (I tend to almost drag my feet when I walk across the house and don't actually see the cat) and after getting an accidental light kick a few times he may do it less often... Seamus is a lot more careful not to get bumped into these days.