How to mimic IK to move a bone using Python without actually setting up IK?
Many parts of Blender are accessible through the python API, like bones. Constraint logic is only accessible as it is via the interface, meaning you can setup constraints with python and bake their transforms.

Here you can see Blender's code structure.


  /source/blender/ikplugin/
  
  Inverse kinematics API, abstracting the itasc and iksolver modules.
  Note that while this system supports multiple inverse-kinematics
  solvers there is no plug-in system exposed from a user perspective.


You are probably interested in the iksolver_plugin.c file, which contains the code to calculate IK.

If you want to implement it from scratch, I recommend an iterative approximation.

Since you are mainly interested in arms and legs though, simple trigonometry will suffice as an IK system with only one joint only has "one" (or no) solution.