The question on making a record like in Mathematica has been discussed in few places, such as Struct data type in Mathematica?.
The problem with all these methods, i
First, I'd like to mention that all the methods you listed are IMO flawed and dangerous. The main reason why I don't like them is that they introduce implicit dependences on global variables (the reasons why this is bad are discussed e.g. here), and can also mess up with the scoping. Another problem of them is that those approaches look like they won't scale nicely to many instances of your structs existing simultaneously. The second method you listed seems the safest, but it has its problems as well (strings as field names, no way to type-check such a struct, also symbols used there may accidentally have a value).
In my post here I discussed a possible way to build mutable data structures where methods can do extra checks. I will copy the relevant piece here:
Unprotect[pair, setFirst, getFirst, setSecond, getSecond, new, delete];
ClearAll[pair, setFirst, getFirst, setSecond, getSecond, new, delete];
Module[{first, second},
first[_] := {};
second[_] := {};
pair /: new[pair[]] := pair[Unique[]];
pair /: new[pair[],fst_?NumericQ,sec_?NumericQ]:=
With[{p=new[pair[]]},
p.setFirst[fst];
p.setSecond[sec];
p];
pair /: pair[tag_].delete[] := (first[tag] =.; second[tag] =.);
pair /: pair[tag_].setFirst[value_?NumericQ] := first[tag] = value;
pair /: pair[tag_].getFirst[] := first[tag];
pair /: pair[tag_].setSecond[value_?NumericQ] := second[tag] = value;
pair /: pair[tag_].getSecond[] := second[tag];
];
Protect[pair, setFirst, getFirst, setSecond, getSecond, new, delete];
Note that I added checks in the constructor and in the setters, to illustrate how this can be done. More details on how to use the structs constructed this way you can find in the mentioned post of mine and further links found there.
Your example would now read:
foo[from_?NumericQ, to_?NumericQ] :=
Module[{}, Plot[Sin[x], {x, from, to}]];
foo[p_pair] := foo[p.getFirst[], p.getSecond[]]
pp = new[pair[], -Pi, Pi];
foo[pp]
Note that the primary advantages of this approach are that state is properly encapsulated, implementation details are hidden, and scoping is not put in danger.