First we need to look at the uncertainties before we address possible solutions:
Are there two motors in use or one - it could be either from your text.
And, is the 40A for two motors in use or one?
You say " ... motor was spun ..." - what does this mean?
An unloaded motor is rated at 2.7A, at normal load it's 27A and max power = 68A.
Where on that continuum is "was spun" ?
You need to describe the nature of the load and your application. Whether it is possible to decrease input power to the motor to within battery specs and still meet your requirement is unknowable to us as you have not provided enough information.
What is the mechanical arrangement?
What attaches to the shaft(s)?
Why do you need to run it at that power?
Why can you not run it at lower power?
Do you use a motor controller or just connect the battery to the motor directly?
Please supply battery model and brand and very ideally a internet link.
What else can you tell us that may help us to help you?
Mechanical:
Changing physical gear ratio inside the gearbox is a mechanical task outside the scope of this form. It is possibly possible, but more likely not to be. Doing this depends on the gearbox design. The manufacturer and/or user community will be able to comment on this.
If you are using or can use a belt or chain drive externally you may be able to change the ratio of pulleys or sprockets used to reduce speed and increase torque.
You MAY be able to move the motor back from where it is mounted so there is miore room and add an inline speed reducer - maybe 2:1.
Electrical:
You can PWM the motor(s) to limit battery current to 25A continuous this will reduce power to probably about 25/40 = 65% of that at 40A but maybe not. Motor efficiency rises usefully with decreasing current but it is not certain how it will run at 25A mean under your load.
Depending on facytors such as PWM frequency and duty cycle, motor imp[edance and more PWM may reduce peak moptor current to mean current or may still cause peaks greater than motor continuous maximum. So, if you use PWM yiou will ideally add capacitance to the PWM input = battery output that will supply the PWNM pulse currents while limiting mean and peak battery currents to no more than the continuous maximum rating.
Battery rated maximim continuous output is 25A.
Based on what you say the unseen by us data sheet says you can run it at 40A for 30 seconds followed by the rest period for 70A in the data sheet - ie at the 70A ratings. You MAY be able to run it for longer safely or with a lower rest period. Or not.
If you provide a link to the battery data sheet and tell us the brand and model we may be able to tell you more. Maybe not, but without that it's a guess at best.
I assume this is a 2-stroke engine.
So you want to use the stepper to deliver power, and hence maintain a relatively constant angular velocity as the power stroke finishes, and continue through compression until the IC engine fires and generates power again.
That should be two fixed points on each rotation, though it might take a bit of care finding where those points are (hence, partly, my comment lower-down about using a high-resolution sensor)
You could sense those positions with two Hall switches and magnets attached to the shaft. That is how some motor vehicle engines sense shaft position.
Hall effect sensors should be good for more than 1000 rps, e.g. 60,000 rpm.
Most reasonable microcontrollers could track 4,000rpm with much better than 0.1% accuracy.
However, driving the stepper, with only 12 steps might be tricky to set up, and drive. 12 steps is 30 degrees per step, which is quite a lot compared to the motor's cycle. This sounds more like a BLDC motor than a stepper motor.
Even with 8 step micro-stepping, the angle is quite big. AND, 8hp is about 6kW+, which is quite a lot of power to switch and control.
Further, to maintain near-maximum torque, the movement of the magnetic field needs to track the motor's rotation reasonably accurately. I'd be tempted to go for 'overkill' and use a high resolution rotation sensor. That might be Hall Effect, like something from AustriaMicroSystems (AMS), or something optical.
Edit:
Texas instruments (TI) have some useful documentation and videos on 'Feld Oriented Control' (FOC) for BDC motors which may help. A web search will find this stuff.
TI have some affordable (sub $100) development boards for low-power (10W?) control too, as does ST Micro, and I'm sure, others. There are 'fast/easy start development kits' for motor control. I haven't used them, but they claim to have control software 'ready to go'.
Summary:
Sensing the shaft position for the IC engine might be a relatively easy part of the project.
Best Answer
This particular datasheet doesn't provide much information about the power curve of the motor it describes. A better example is this (not endorsing the particular motor, just picked at random for the information it presents). The important bit is the graph at the bottom of the second page, which shows, for each of the motors the datasheet describes, a curve relating frequency to torque, at a particular voltage-current.
Reading that graph for the detail you need to know is basically straitforward. You will need to know the torque you expect to need for your application, and find the corresponding frequency. Each oscillation of input represents four full steps of motion, and since these motors are 1.8 deg/step, you can take that frequency and divide by 50 to get the RPM.
For example, supposing you needed about 0.2 Newton meters of torque, and went with the biggest motor on that datasheet, you would find that it could operate at about 2500 Hz, which equates to about 50 RPM. However, it's usually wise to derate stepper motors in an open loop configuration to minimize the likelyhood of missing steps, so it might be best to run that motor at around 30 RPM so that you can have around 0.30 Nm at hand.