The slingshot effect is actually a form of performing time travel. From Memory Alpha:
The slingshot effect, also known as the light-speed breakaway factor,
was a method of time travel through the use of an artificially-created
time warp. This maneuver was performed by traveling at an extremely
high warp factor towards a massive body with a high gravitational
attraction, such as a star. After allowing the gravitational pull to
accelerate the vessel to even faster speeds, the vessel would then
break away from the stellar body, creating a whiplash effect which
could transport the vessel through time. Performing this maneuver
required extremely precise calculations to be made, such as
availability of fuel components, acceleration, and mass of a vessel
through a time continuum. (TOS: "Tomorrow is Yesterday"; Star Trek IV:
The Voyage Home)
The only reason they performed time travel was so that they could prevent the destruction of Earth in the future. I would assume that time travel is most likely banned because doing so would cause alterations to the universe, for instance in the New Star Trek movies it caused a second divergent timeline to emerge and caused the original Spock to be stuck there.
Anyway Spock actually did most of the computations for the time jump from memory. From the Memory Alpha page for Star Trek IV: The Voyage Home:
On Earth, a faint transmission believed to be from Admiral Kirk is
received and Cartwright orders it put through. Kirk advises Starfleet
of their analysis of the probe's signal, tells them that Spock's
theory is that only the extinct humpback whale can properly answer the
probe and because of this, they are going to try time travel and they
are computing their trajectory at the same time. At that moment,
Kirk's signal degrades. Cartwright orders the transmission picked back
up, but just then the windows behind him shatter and the wind and rain
begin to blow into Starfleet Headquarters. At this point, all anyone
in the command center can do is wait.
On the Bounty, Spock has completed his calculations and informs Kirk
their time target is the late 20th century. Unfortunately he can't be
more precise because of the limits of the equipment aboard the Bounty.
Additionally he had to program some of the variables for his time
travel computations from memory. When McCoy worriedly recites a line
from Hamlet and Spock recognizes it, Kirk establishes his faith in
Spock's memory and has the ship prepared for warp speed. Kirk orders
Chekov to raise the shields and then tells Sulu to engage the Bounty's
warp drive.
There's no reason to assume that the Federation CAN'T time travel, but are most likely not willing to do so in fear of changing events. The events in the movie is a rare occasion where they would be willing to allow time travel as an option.